diff --git a/swaggerci/cost-management/.gitattributes b/swaggerci/cost-management/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/cost-management/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/cost-management/.gitignore b/swaggerci/cost-management/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/cost-management/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/cost-management/Az.Cost.csproj b/swaggerci/cost-management/Az.Cost.csproj new file mode 100644 index 000000000000..e3e673ef8e8a --- /dev/null +++ b/swaggerci/cost-management/Az.Cost.csproj @@ -0,0 +1,44 @@ + + + + 0.1.0 + 7.1 + netstandard2.0 + Library + Az.Cost.private + Microsoft.Azure.PowerShell.Cmdlets.Cost + true + false + ./bin + $(OutputPath) + Az.Cost.nuspec + true + + + 1998, 1591 + true + + + + + false + TRACE;DEBUG;NETSTANDARD + + + + true + true + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + + + + + + $(DefaultItemExcludes);resources/** + + + \ No newline at end of file diff --git a/swaggerci/cost-management/Az.Cost.format.ps1xml b/swaggerci/cost-management/Az.Cost.format.ps1xml new file mode 100644 index 000000000000..5b7460e5d10b --- /dev/null +++ b/swaggerci/cost-management/Az.Cost.format.ps1xml @@ -0,0 +1,2749 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.CostIdentity + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.CostIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AlertId + + + BillingAccountId + + + BillingProfileId + + + ExportName + + + ExternalCloudProviderId + + + ExternalCloudProviderType + + + Id + + + OperationId + + + Scope + + + ViewName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders + + + + + + + + + + + + + + + Location + + + RetryAfter + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders + + + + + + + + + + + + + + + + + + + + + AzureAsyncOperation + + + AzureConsumptionAsyncOperation + + + Location + + + RetryAfter + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders + + + + + + + + + + + + + + + Location + + + RetryAfter + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders + + + + + + + + + + + + + + + Location + + + RetryAfter + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.BlobInfo + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.BlobInfo + + + + + + + + + + + + + + + BlobLink + + + ByteCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsOperationResults + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsOperationResults + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Status + + + Type + + + ValidTill + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriod + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriod + + + + + + + + + + + + + + + End + + + Start + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinition + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinition + + + + + + + + + + + + + + + + + + BillingPeriod + + + InvoiceId + + + Metric + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ReportManifest + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ReportManifest + + + + + + + + + + + + + + + + + + + + + + + + BlobCount + + + ByteCount + + + CompressData + + + DataFormat + + + ManifestVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.RequestContext + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.RequestContext + + + + + + + + + + + + RequestScope + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Alert + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Alert + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CloseTime + + + CostEntityId + + + CreationTime + + + Description + + + ModificationTime + + + Source + + + Status + + + StatusModificationTime + + + StatusModificationUserName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinition + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinition + + + + + + + + + + + + + + + + + + Category + + + Criterion + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetails + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetails + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Amount + + + CompanyName + + + ContactEmail + + + ContactGroup + + + ContactRole + + + CurrentSpend + + + DepartmentName + + + EnrollmentEndDate + + + EnrollmentNumber + + + EnrollmentStartDate + + + InvoicingThreshold + + + Operator + + + OverridingAlert + + + PeriodStartDate + + + Threshold + + + TimeGrainType + + + TriggeredBy + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertsResult + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertsResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportProperties + + + + + + + + + + + + + + + + + + Format + + + NextRunTimeEstimate + + + PartitionData + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Dimension + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Dimension + + + + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Sku + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Category + + + Data + + + Description + + + FilterEnabled + + + GroupingEnabled + + + NextLink + + + Total + + + UsageEnd + + + UsageStart + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrl + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrl + + + + + + + + + + + + + + + DownloadUrl1 + + + ValidTill + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Export + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Export + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDataset + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDataset + + + + + + + + + + + + Granularity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfiguration + + + + + + + + + + + + Column + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinition + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinition + + + + + + + + + + + + + + + Timeframe + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestination + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestination + + + + + + + + + + + + + + + + + + + + + + + + Container + + + ResourceId + + + RootFolderPath + + + SasToken + + + StorageAccount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecution + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecution + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ExecutionType + + + FileName + + + ProcessingEndTime + + + ProcessingStartTime + + + Status + + + SubmittedBy + + + SubmittedTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ConfigurationColumn + + + DataSetGranularity + + + DefinitionTimeframe + + + DefinitionType + + + DestinationContainer + + + DestinationResourceId + + + DestinationRootFolderPath + + + DestinationSasToken + + + DestinationStorageAccount + + + Format + + + NextRunTimeEstimate + + + PartitionData + + + TimePeriodFrom + + + TimePeriodTo + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriod + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriod + + + + + + + + + + + + + + + From + + + To + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportSchedule + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportSchedule + + + + + + + + + + + + + + + Recurrence + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriod + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriod + + + + + + + + + + + + + + + From + + + To + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastAggregation + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastAggregation + + + + + + + + + + + + + + + Function + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastColumn + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastColumn + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpression + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpression + + + + + + + + + + + + + + + + + + Name + + + Operator + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDataset + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDataset + + + + + + + + + + + + Granularity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetConfiguration + + + + + + + + + + + + Column + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDefinition + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDefinition + + + + + + + + + + + + + + + + + + + + + IncludeActualCost + + + IncludeFreshPartialCost + + + Timeframe + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastProperties + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastResult + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastResult + + + + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Sku + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastTimePeriod + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastTimePeriod + + + + + + + + + + + + + + + From + + + To + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportDefinition + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportDefinition + + + + + + + + + + + + + + + + + + + + + BillingPeriod + + + CustomerId + + + InvoiceId + + + Metric + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportOperationResult + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportOperationResult + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportOperationStatuses + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportOperationStatuses + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportTimePeriod + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportTimePeriod + + + + + + + + + + + + + + + End + + + Start + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.KpiProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.KpiProperties + + + + + + + + + + + + + + + + + + Enabled + + + Id + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Operation + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Operation + + + + + + + + + + + + + + + Id + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationDisplay + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationDisplay + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationListResult + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationStatus + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationStatus + + + + + + + + + + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.PivotProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.PivotProperties + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ProxyResource + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ProxyResource + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryAggregation + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryAggregation + + + + + + + + + + + + + + + Function + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryColumn + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryColumn + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression + + + + + + + + + + + + + + + + + + Name + + + Operator + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDataset + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDataset + + + + + + + + + + + + Granularity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetConfiguration + + + + + + + + + + + + Column + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDefinition + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDefinition + + + + + + + + + + + + + + + Timeframe + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryGrouping + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryGrouping + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryProperties + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryResult + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryResult + + + + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Sku + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryTimePeriod + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryTimePeriod + + + + + + + + + + + + + + + From + + + To + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigAggregation + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigAggregation + + + + + + + + + + + + + + + Function + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpression + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpression + + + + + + + + + + + + + + + + + + Name + + + Operator + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDataset + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDataset + + + + + + + + + + + + Granularity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetConfiguration + + + + + + + + + + + + Column + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDefinition + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDefinition + + + + + + + + + + + + + + + + + + IncludeMonetaryCommitment + + + Timeframe + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigGrouping + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigGrouping + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigSorting + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigSorting + + + + + + + + + + + + + + + Direction + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigTimePeriod + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigTimePeriod + + + + + + + + + + + + + + + From + + + To + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportUrl + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportUrl + + + + + + + + + + + + + + + ReportUrl1 + + + ValidUntil + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Resource + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Resource + + + + + + + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Location + + + Name + + + Sku + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Status + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Status + + + + + + + + + + + + Status1 + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View + + + + + + + + + + + + + + + + + + + + + ETag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewListResult + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewProperties + + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Accumulated + + + Chart + + + CreatedOn + + + Currency + + + DateRange + + + DisplayName + + + Metric + + + ModifiedOn + + + Scope + + + + + + + + \ No newline at end of file diff --git a/swaggerci/cost-management/Az.Cost.nuspec b/swaggerci/cost-management/Az.Cost.nuspec new file mode 100644 index 000000000000..72475994b3aa --- /dev/null +++ b/swaggerci/cost-management/Az.Cost.nuspec @@ -0,0 +1,32 @@ + + + + Az.Cost + 0.1.0 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell: $(service-name) cmdlets + + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM PSModule $(service-name) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/cost-management/Az.Cost.psd1 b/swaggerci/cost-management/Az.Cost.psd1 new file mode 100644 index 000000000000..b6e65fafb5f2 --- /dev/null +++ b/swaggerci/cost-management/Az.Cost.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = '9db75e2f-de4d-4383-b0c3-93bb0cae9f2a' + RootModule = './Az.Cost.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: Cost cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.Cost.private.dll' + FormatsToProcess = './Az.Cost.format.ps1xml' + FunctionsToExport = 'Get-AzCostAlert', 'Get-AzCostAlertExternal', 'Get-AzCostDimension', 'Get-AzCostExport', 'Get-AzCostExportExecutionHistory', 'Get-AzCostGenerateCostDetailReportOperationResult', 'Get-AzCostGenerateDetailedCostReportOperationResult', 'Get-AzCostGenerateDetailedCostReportOperationStatus', 'Get-AzCostView', 'Invoke-AzCostByDimensionExternalCloudProviderType', 'Invoke-AzCostByGenerateReservationDetailReportBillingAccountId', 'Invoke-AzCostByGenerateReservationDetailReportBillingProfileId', 'Invoke-AzCostCloudForecast', 'Invoke-AzCostDismissAlert', 'Invoke-AzCostExecuteExport', 'Invoke-AzCostUsageForecast', 'Invoke-AzCostUsageQuery', 'New-AzCostExport', 'New-AzCostGenerateCostDetailReportOperation', 'New-AzCostGenerateDetailedCostReportOperation', 'New-AzCostView', 'Remove-AzCostExport', 'Remove-AzCostView', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Cost' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/swaggerci/cost-management/Az.Cost.psm1 b/swaggerci/cost-management/Az.Cost.psm1 new file mode 100644 index 000000000000..0304de739aef --- /dev/null +++ b/swaggerci/cost-management/Az.Cost.psm1 @@ -0,0 +1,107 @@ +# region Generated + # ---------------------------------------------------------------------------------- + # 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. + # ---------------------------------------------------------------------------------- + # Load required Az.Accounts module + $accountsName = 'Az.Accounts' + $accountsModule = Get-Module -Name $accountsName + if(-not $accountsModule) { + $localAccountsPath = Join-Path $PSScriptRoot 'generated/modules' + if(Test-Path -Path $localAccountsPath) { + $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1 + if($localAccounts) { + $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru + } + } + if(-not $accountsModule) { + $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0 + if($hasAdequateVersion) { + $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru + } + } + } + + if(-not $accountsModule) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop + } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop + } + Write-Information "Loaded Module '$($accountsModule.Name)'" + + # Load the private module dll + $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.Cost.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Module]::Instance + + # Ask for the shared functionality table + $VTable = Register-AzModule + + # Tweaks the pipeline on module load + $instance.OnModuleLoad = $VTable.OnModuleLoad + + # Following two delegates are added for telemetry + $instance.GetTelemetryId = $VTable.GetTelemetryId + $instance.Telemetry = $VTable.Telemetry + + + # Tweaks the pipeline per call + $instance.OnNewRequest = $VTable.OnNewRequest + + # Gets shared parameter values + $instance.GetParameterValue = $VTable.GetParameterValue + + # Allows shared module to listen to events from this module + $instance.EventListener = $VTable.EventListener + + # Gets shared argument completers + $instance.ArgumentCompleter = $VTable.ArgumentCompleter + + # The name of the currently selected Azure profile + $instance.ProfileName = $VTable.ProfileName + + + # Load the custom module + $customModulePath = Join-Path $PSScriptRoot './custom/Az.Cost.custom.psm1' + if(Test-Path $customModulePath) { + $null = Import-Module -Name $customModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = Join-Path $PSScriptRoot './exports' + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } + + # Finalize initialization of this module + $instance.Init(); + Write-Information "Loaded Module '$($instance.Name)'" +# endregion diff --git a/swaggerci/cost-management/MSSharedLibKey.snk b/swaggerci/cost-management/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/cost-management/MSSharedLibKey.snk differ diff --git a/swaggerci/cost-management/README.md b/swaggerci/cost-management/README.md new file mode 100644 index 000000000000..4e87b77cd99e --- /dev/null +++ b/swaggerci/cost-management/README.md @@ -0,0 +1,27 @@ + +# Az.Cost +This directory contains the PowerShell module for the Cost service. + +--- +## Status +[![Az.Cost](https://img.shields.io/powershellgallery/v/Az.Cost.svg?style=flat-square&label=Az.Cost "Az.Cost")](https://www.powershellgallery.com/packages/Az.Cost/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.Cost`, see [how-to.md](how-to.md). + diff --git a/swaggerci/cost-management/build-module.ps1 b/swaggerci/cost-management/build-module.ps1 new file mode 100644 index 000000000000..4f7e3ed1eac6 --- /dev/null +++ b/swaggerci/cost-management/build-module.ps1 @@ -0,0 +1,153 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs) +$ErrorActionPreference = 'Stop' + +if($PSEdition -ne 'Core') { + Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.' +} + +if(-not $Isolated -and -not $Debugger) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + + if($LastExitCode -ne 0) { + # Build failed. Don't attempt to run the module. + return + } + + if($Test) { + . (Join-Path $PSScriptRoot 'test-module.ps1') + if($LastExitCode -ne 0) { + # Tests failed. Don't attempt to run the module. + return + } + } + + if($Docs) { + . (Join-Path $PSScriptRoot 'generate-help.ps1') + if($LastExitCode -ne 0) { + # Docs generation failed. Don't attempt to run the module. + return + } + } + + if($Pack) { + . (Join-Path $PSScriptRoot 'pack-module.ps1') + if($LastExitCode -ne 0) { + # Packing failed. Don't attempt to run the module. + return + } + } + + $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1' + if($Code) { + . $runModulePath -Code + } elseif($Run) { + . $runModulePath + } else { + Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script." + } + return +} + +$binFolder = Join-Path $PSScriptRoot 'bin' +$objFolder = Join-Path $PSScriptRoot 'obj' + +if(-not $Debugger) { + Write-Host -ForegroundColor Green 'Cleaning build folders...' + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder + + if((Test-Path $binFolder) -or (Test-Path $objFolder)) { + Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?' + Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.' + } + + Write-Host -ForegroundColor Green 'Compiling module...' + $buildConfig = 'Debug' + if($Release) { + $buildConfig = 'Release' + } + dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo + if($LastExitCode -ne 0) { + Write-Error 'Compilation failed.' + } + + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release') +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.Cost.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} + +# Load DLL to use build-time cmdlets +$null = Import-Module -Name $dll + +$modulePaths = $dll +$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.Cost.custom.psm1' +if(Test-Path $customPsm1) { + $modulePaths = @($dll, $customPsm1) +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(Test-Path $exportsFolder) { + $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $exportsFolder + +$internalFolder = Join-Path $PSScriptRoot 'internal' +if(Test-Path $internalFolder) { + $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $internalFolder + +$psd1 = Join-Path $PSScriptRoot './Az.Cost.psd1' +$guid = Get-ModuleGuid -Psd1Path $psd1 +$moduleName = 'Az.Cost' +$examplesFolder = Join-Path $PSScriptRoot 'examples' +$null = New-Item -ItemType Directory -Force -Path $examplesFolder + +Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...' +$modelCmdlets = @() +if ($modelCmdlets.Count -gt 0) { + . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') + CreateModelCmdlet($modelCmdlets) +} + +if($NoDocs) { + Write-Host -ForegroundColor Green 'Creating exports...' + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder +} else { + Write-Host -ForegroundColor Green 'Creating exports and docs...' + $moduleDescription = 'Microsoft Azure PowerShell: Cost cmdlets' + $docsFolder = Join-Path $PSScriptRoot 'docs' + if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue + } + $null = New-Item -ItemType Directory -Force -Path $docsFolder + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid +} + +Write-Host -ForegroundColor Green 'Creating format.ps1xml...' +$formatPs1xml = Join-Path $PSScriptRoot './Az.Cost.format.ps1xml' +Export-FormatPs1xml -FilePath $formatPs1xml + +Write-Host -ForegroundColor Green 'Creating psd1...' +$customFolder = Join-Path $PSScriptRoot 'custom' +Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid + +Write-Host -ForegroundColor Green 'Creating test stubs...' +$testFolder = Join-Path $PSScriptRoot 'test' +$null = New-Item -ItemType Directory -Force -Path $testFolder +Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder + +Write-Host -ForegroundColor Green 'Creating example stubs...' +Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder + +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/swaggerci/cost-management/check-dependencies.ps1 b/swaggerci/cost-management/check-dependencies.ps1 new file mode 100644 index 000000000000..ec3055201a71 --- /dev/null +++ b/swaggerci/cost-management/check-dependencies.ps1 @@ -0,0 +1,57 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) { + if($predicate) { + $module = Get-Module -ListAvailable -Name $moduleName + if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) { + $null = New-Item -ItemType Directory -Force -Path $path + Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..." + if ($requiredVersion) { + Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path + }elseif($versionMinimum) { + Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path + } else { + Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path + } + } + } +} + +$ProgressPreference = 'SilentlyContinue' +$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1 + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5' +DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1' + +$tools = Join-Path $PSScriptRoot 'tools' +$resourceDir = Join-Path $tools 'Resources' +$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1' + +if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) { + Write-Host -ForegroundColor Green "Building local Resource module used for test..." + Set-Location $resourceDir + $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources + $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/ + Set-Location $HOME/.PSSharedModules/Resources + $null = .\build-module.ps1 + Set-Location $PSScriptRoot +} diff --git a/swaggerci/cost-management/create-model-cmdlets.ps1 b/swaggerci/cost-management/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..7e8ee2f5afdb --- /dev/null +++ b/swaggerci/cost-management/create-model-cmdlets.ps1 @@ -0,0 +1,163 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +function CreateModelCmdlet { + + param([string[]]$Models) + + if ($Models.Count -eq 0) + { + return + } + + $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models' + $ModuleName = 'Cost' + $OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets' + $null = New-Item -ItemType Directory -Force -Path $OutputDir + + $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs + $Content = '' + $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 ) + { $Content += get-content $_.fullname -raw + } } + + $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content) + $Nodes = $Tree.ChildNodes().ChildNodes() + foreach ($Model in $Models) + { + $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") } + if ($InterfaceNode.count -eq 0) { + continue + } + # through a queue, we iterate all the parent models. + $Queue = @($InterfaceNode) + $visited = @("I$Model") + $AllInterfaceNodes = @() + while ($Queue.count -ne 0) + { + $AllInterfaceNodes += $Queue[0] + # Baselist contains the direct parent models. + foreach ($parent in $Queue[0].BaseList.Types) + { + if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value))) + { + $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) }) + $visited = [Array]$visited + $parent.Type.Right.Identifier.Value + } + } + $first, $Queue = $Queue + } + + $Namespace = $InterfaceNode.Parent.Name + $ObjectType = $Model + $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}" + # remove duplicated module name + if ($ObjectType.StartsWith($ModuleName)) { + $ModulePrefix = '' + } else { + $ModulePrefix = $ModuleName + } + $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir + + $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string] + $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string] + foreach ($Node in $AllInterfaceNodes) + { + foreach ($Member in $Node.Members) + { + $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments + $Required = $false + $Description = "" + $Readonly = $False + foreach ($Argument in $Arguments) + { + if ($Argument.NameEquals.Name.Identifier.Value -eq "Required") + { + $Required = $Argument.Expression.Token.Value + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Description") + { + $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"') + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly") + { + $Readonly = $Argument.Expression.Token.Value + } + } + if ($Readonly) + { + continue + } + $Identifier = $Member.Identifier.Value + $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1] + $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string] + if ($Required) + { + $ParameterDefinePropertyList.Add("Mandatory") + } + if ($Description -ne "") + { + $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"") + } + $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList) + # check whether completer is needed + $completer = ''; + if($Type.Split('.').Split('.')[-2] -eq 'Support') { + # If Type is an array, need to strip [] + $strippedType = $Type.Replace('[]', '') + $completer += "`n [ArgumentCompleter([${strippedType}])]" + } + $ParameterDefineScript = " + [Parameter($ParameterDefineProperty)]${completer} + [${Type}] + `$${Identifier}" + $ParameterDefineScriptList.Add($ParameterDefineScript) + $ParameterAssignScriptList.Add(" + if (`$PSBoundParameters.ContainsKey('${Identifier}')) { + `$Object.${Identifier} = `$${Identifier} + }") + } + } + $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator "," + $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator "" + + $Script = " +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ${ObjectType}. +.Description +Create an in-memory object for ${ObjectType}. + +.Outputs +${ObjectTypeWithNamespace} +.Link +https://docs.microsoft.com/en-us/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object +#> +function New-Az${ModulePrefix}${ObjectType}Object { + [OutputType('${ObjectTypeWithNamespace}')] + [CmdletBinding(PositionalBinding=`$false)] + Param( +${ParameterDefineScript} + ) + + process { + `$Object = [${ObjectTypeWithNamespace}]::New() +${ParameterAssignScript} + return `$Object + } +} +" + Set-Content -Path $OutputPath -Value $Script + } +} diff --git a/swaggerci/cost-management/custom/Az.Cost.custom.psm1 b/swaggerci/cost-management/custom/Az.Cost.custom.psm1 new file mode 100644 index 000000000000..36f50ae14ad9 --- /dev/null +++ b/swaggerci/cost-management/custom/Az.Cost.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Cost.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Cost.internal.psm1' + if(Test-Path $internalModulePath) { + $null = Import-Module -Name $internalModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export script cmdlets + Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias) +# endregion diff --git a/swaggerci/cost-management/custom/README.md b/swaggerci/cost-management/custom/README.md new file mode 100644 index 000000000000..8fd1d55007f7 --- /dev/null +++ b/swaggerci/cost-management/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.Cost` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.Cost.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.Cost` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.Cost.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.Cost.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.Cost`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.Cost.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.Cost.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Cost`. +- `Microsoft.Azure.PowerShell.Cmdlets.Cost.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.Cost`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.Cost.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/swaggerci/cost-management/docs/Az.Cost.md b/swaggerci/cost-management/docs/Az.Cost.md new file mode 100644 index 000000000000..bcd54e58ee6b --- /dev/null +++ b/swaggerci/cost-management/docs/Az.Cost.md @@ -0,0 +1,103 @@ +--- +Module Name: Az.Cost +Module Guid: 9db75e2f-de4d-4383-b0c3-93bb0cae9f2a +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.cost +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.Cost Module +## Description +Microsoft Azure PowerShell: Cost cmdlets + +## Az.Cost Cmdlets +### [Get-AzCostAlert](Get-AzCostAlert.md) +Gets the alert for the scope by alert ID. + +### [Get-AzCostAlertExternal](Get-AzCostAlertExternal.md) +Lists the Alerts for external cloud provider type defined. + +### [Get-AzCostDimension](Get-AzCostDimension.md) +Lists the dimensions by the defined scope. + +### [Get-AzCostExport](Get-AzCostExport.md) +The operation to get the export for the defined scope by export name. + +### [Get-AzCostExportExecutionHistory](Get-AzCostExportExecutionHistory.md) +The operation to get the execution history of an export for the defined scope and export name. + +### [Get-AzCostGenerateCostDetailReportOperationResult](Get-AzCostGenerateCostDetailReportOperationResult.md) +Get the result of the specified operation. +This link is provided in the CostDetails creation request response Location header. + +### [Get-AzCostGenerateDetailedCostReportOperationResult](Get-AzCostGenerateDetailedCostReportOperationResult.md) +Get the result of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. + +### [Get-AzCostGenerateDetailedCostReportOperationStatus](Get-AzCostGenerateDetailedCostReportOperationStatus.md) +Get the status of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. + +### [Get-AzCostView](Get-AzCostView.md) +Gets the view by view name. + +### [Invoke-AzCostByDimensionExternalCloudProviderType](Invoke-AzCostByDimensionExternalCloudProviderType.md) +Lists the dimensions by the external cloud provider type. + +### [Invoke-AzCostByGenerateReservationDetailReportBillingAccountId](Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.md) +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 + +### [Invoke-AzCostByGenerateReservationDetailReportBillingProfileId](Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.md) +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 + +### [Invoke-AzCostCloudForecast](Invoke-AzCostCloudForecast.md) +Lists the forecast charges for external cloud provider type defined. + +### [Invoke-AzCostDismissAlert](Invoke-AzCostDismissAlert.md) +Dismisses the specified alert + +### [Invoke-AzCostExecuteExport](Invoke-AzCostExecuteExport.md) +The operation to execute an export. + +### [Invoke-AzCostUsageForecast](Invoke-AzCostUsageForecast.md) +Lists the forecast charges for scope defined. + +### [Invoke-AzCostUsageQuery](Invoke-AzCostUsageQuery.md) +Query the usage data for scope defined. + +### [New-AzCostExport](New-AzCostExport.md) +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. + +### [New-AzCostGenerateCostDetailReportOperation](New-AzCostGenerateCostDetailReportOperation.md) +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. + +### [New-AzCostGenerateDetailedCostReportOperation](New-AzCostGenerateDetailedCostReportOperation.md) +Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. +Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. +A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored. + +### [New-AzCostView](New-AzCostView.md) +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. + +### [Remove-AzCostExport](Remove-AzCostExport.md) +The operation to delete a export. + +### [Remove-AzCostView](Remove-AzCostView.md) +The operation to delete a view. + diff --git a/swaggerci/cost-management/docs/Get-AzCostAlert.md b/swaggerci/cost-management/docs/Get-AzCostAlert.md new file mode 100644 index 000000000000..c5752fe9014c --- /dev/null +++ b/swaggerci/cost-management/docs/Get-AzCostAlert.md @@ -0,0 +1,156 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostalert +schema: 2.0.0 +--- + +# Get-AzCostAlert + +## SYNOPSIS +Gets the alert for the scope by alert ID. + +## SYNTAX + +### List (Default) +``` +Get-AzCostAlert -Scope [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzCostAlert -Id -Scope [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzCostAlert -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the alert for the scope by alert ID. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Alert ID + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: AlertId + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Scope +The scope associated with alerts operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Get-AzCostAlertExternal.md b/swaggerci/cost-management/docs/Get-AzCostAlertExternal.md new file mode 100644 index 000000000000..41ee93acd51b --- /dev/null +++ b/swaggerci/cost-management/docs/Get-AzCostAlertExternal.md @@ -0,0 +1,109 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostalertexternal +schema: 2.0.0 +--- + +# Get-AzCostAlertExternal + +## SYNOPSIS +Lists the Alerts for external cloud provider type defined. + +## SYNTAX + +``` +Get-AzCostAlertExternal -ExternalCloudProviderId + -ExternalCloudProviderType [-DefaultProfile ] [] +``` + +## DESCRIPTION +Lists the Alerts for external cloud provider type defined. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderId +This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderType +The external cloud provider type associated with dimension/query operations. +This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Get-AzCostDimension.md b/swaggerci/cost-management/docs/Get-AzCostDimension.md new file mode 100644 index 000000000000..8bacf663e75d --- /dev/null +++ b/swaggerci/cost-management/docs/Get-AzCostDimension.md @@ -0,0 +1,172 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostdimension +schema: 2.0.0 +--- + +# Get-AzCostDimension + +## SYNOPSIS +Lists the dimensions by the defined scope. + +## SYNTAX + +``` +Get-AzCostDimension -Scope [-Expand ] [-Filter ] [-Skiptoken ] [-Top ] + [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Lists the dimensions by the defined scope. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +May be used to expand the properties/data within a dimension category. +By default, data is not included when listing dimensions. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. +Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Skiptoken +Skiptoken is only used if a previous operation returned a partial result. +If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +May be used to limit the number of results to the most recent N dimension data. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Get-AzCostExport.md b/swaggerci/cost-management/docs/Get-AzCostExport.md new file mode 100644 index 000000000000..6e86426ef5f9 --- /dev/null +++ b/swaggerci/cost-management/docs/Get-AzCostExport.md @@ -0,0 +1,172 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostexport +schema: 2.0.0 +--- + +# Get-AzCostExport + +## SYNOPSIS +The operation to get the export for the defined scope by export name. + +## SYNTAX + +### List (Default) +``` +Get-AzCostExport -Scope [-Expand ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzCostExport -Name -Scope [-Expand ] [-DefaultProfile ] + [] +``` + +### GetViaIdentity +``` +Get-AzCostExport -InputObject [-Expand ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +The operation to get the export for the defined scope by export name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Export Name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ExportName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Get-AzCostExportExecutionHistory.md b/swaggerci/cost-management/docs/Get-AzCostExportExecutionHistory.md new file mode 100644 index 000000000000..f156e13f4262 --- /dev/null +++ b/swaggerci/cost-management/docs/Get-AzCostExportExecutionHistory.md @@ -0,0 +1,151 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostexportexecutionhistory +schema: 2.0.0 +--- + +# Get-AzCostExportExecutionHistory + +## SYNOPSIS +The operation to get the execution history of an export for the defined scope and export name. + +## SYNTAX + +### Get (Default) +``` +Get-AzCostExportExecutionHistory -ExportName -Scope [-DefaultProfile ] + [] +``` + +### GetViaIdentity +``` +Get-AzCostExportExecutionHistory -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +The operation to get the execution history of an export for the defined scope and export name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExportName +Export Name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Get-AzCostGenerateCostDetailReportOperationResult.md b/swaggerci/cost-management/docs/Get-AzCostGenerateCostDetailReportOperationResult.md new file mode 100644 index 000000000000..42dcb24c75f3 --- /dev/null +++ b/swaggerci/cost-management/docs/Get-AzCostGenerateCostDetailReportOperationResult.md @@ -0,0 +1,184 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostgeneratecostdetailreportoperationresult +schema: 2.0.0 +--- + +# Get-AzCostGenerateCostDetailReportOperationResult + +## SYNOPSIS +Get the result of the specified operation. +This link is provided in the CostDetails creation request response Location header. + +## SYNTAX + +### Get (Default) +``` +Get-AzCostGenerateCostDetailReportOperationResult -OperationId -Scope + [-DefaultProfile ] [-AsJob] [-NoWait] [] +``` + +### GetViaIdentity +``` +Get-AzCostGenerateCostDetailReportOperationResult -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [] +``` + +## DESCRIPTION +Get the result of the specified operation. +This link is provided in the CostDetails creation request response Location header. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OperationId +The target operation Id. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Get-AzCostGenerateDetailedCostReportOperationResult.md b/swaggerci/cost-management/docs/Get-AzCostGenerateDetailedCostReportOperationResult.md new file mode 100644 index 000000000000..a4c8199207a7 --- /dev/null +++ b/swaggerci/cost-management/docs/Get-AzCostGenerateDetailedCostReportOperationResult.md @@ -0,0 +1,169 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostgeneratedetailedcostreportoperationresult +schema: 2.0.0 +--- + +# Get-AzCostGenerateDetailedCostReportOperationResult + +## SYNOPSIS +Get the result of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. + +## SYNTAX + +### Get (Default) +``` +Get-AzCostGenerateDetailedCostReportOperationResult -OperationId -Scope + [-DefaultProfile ] [-PassThru] [] +``` + +### GetViaIdentity +``` +Get-AzCostGenerateDetailedCostReportOperationResult -InputObject [-DefaultProfile ] + [-PassThru] [] +``` + +## DESCRIPTION +Get the result of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -OperationId +The target operation Id. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Get-AzCostGenerateDetailedCostReportOperationStatus.md b/swaggerci/cost-management/docs/Get-AzCostGenerateDetailedCostReportOperationStatus.md new file mode 100644 index 000000000000..e4fc41ac8983 --- /dev/null +++ b/swaggerci/cost-management/docs/Get-AzCostGenerateDetailedCostReportOperationStatus.md @@ -0,0 +1,154 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostgeneratedetailedcostreportoperationstatus +schema: 2.0.0 +--- + +# Get-AzCostGenerateDetailedCostReportOperationStatus + +## SYNOPSIS +Get the status of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. + +## SYNTAX + +### Get (Default) +``` +Get-AzCostGenerateDetailedCostReportOperationStatus -OperationId -Scope + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzCostGenerateDetailedCostReportOperationStatus -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Get the status of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -OperationId +The target operation Id. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Get-AzCostView.md b/swaggerci/cost-management/docs/Get-AzCostView.md new file mode 100644 index 000000000000..af940ca7e9b4 --- /dev/null +++ b/swaggerci/cost-management/docs/Get-AzCostView.md @@ -0,0 +1,169 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostview +schema: 2.0.0 +--- + +# Get-AzCostView + +## SYNOPSIS +Gets the view by view name. + +## SYNTAX + +### List (Default) +``` +Get-AzCostView [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzCostView -Name [-DefaultProfile ] [] +``` + +### Get1 +``` +Get-AzCostView -Name -Scope [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzCostView -InputObject [-DefaultProfile ] [] +``` + +### GetViaIdentity1 +``` +Get-AzCostView -InputObject [-DefaultProfile ] [] +``` + +### List1 +``` +Get-AzCostView -Scope [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the view by view name. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: GetViaIdentity, GetViaIdentity1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +View name + +```yaml +Type: System.String +Parameter Sets: Get, Get1 +Aliases: ViewName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Get1, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Invoke-AzCostByDimensionExternalCloudProviderType.md b/swaggerci/cost-management/docs/Invoke-AzCostByDimensionExternalCloudProviderType.md new file mode 100644 index 000000000000..a8c643225edf --- /dev/null +++ b/swaggerci/cost-management/docs/Invoke-AzCostByDimensionExternalCloudProviderType.md @@ -0,0 +1,215 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostbydimensionexternalcloudprovidertype +schema: 2.0.0 +--- + +# Invoke-AzCostByDimensionExternalCloudProviderType + +## SYNOPSIS +Lists the dimensions by the external cloud provider type. + +## SYNTAX + +### By (Default) +``` +Invoke-AzCostByDimensionExternalCloudProviderType -ExternalCloudProviderId + -ExternalCloudProviderType [-Expand ] [-Filter ] + [-Skiptoken ] [-Top ] [-DefaultProfile ] [] +``` + +### ByViaIdentity +``` +Invoke-AzCostByDimensionExternalCloudProviderType -InputObject [-Expand ] + [-Filter ] [-Skiptoken ] [-Top ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Lists the dimensions by the external cloud provider type. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +May be used to expand the properties/data within a dimension category. +By default, data is not included when listing dimensions. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderId +This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + +```yaml +Type: System.String +Parameter Sets: By +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderType +The external cloud provider type associated with dimension/query operations. +This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType +Parameter Sets: By +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. +Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: ByViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Skiptoken +Skiptoken is only used if a previous operation returned a partial result. +If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Top +May be used to limit the number of results to the most recent N dimension data. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.md b/swaggerci/cost-management/docs/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.md new file mode 100644 index 000000000000..94cfb4264d0b --- /dev/null +++ b/swaggerci/cost-management/docs/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostbygeneratereservationdetailreportbillingaccountid +schema: 2.0.0 +--- + +# Invoke-AzCostByGenerateReservationDetailReportBillingAccountId + +## SYNOPSIS +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 + +## SYNTAX + +### By (Default) +``` +Invoke-AzCostByGenerateReservationDetailReportBillingAccountId -BillingAccountId -EndDate + -StartDate [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### ByViaIdentity +``` +Invoke-AzCostByGenerateReservationDetailReportBillingAccountId -InputObject -EndDate + -StartDate [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## 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 + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingAccountId +Enrollment ID (Legacy BillingAccount ID) + +```yaml +Type: System.String +Parameter Sets: By +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndDate +End Date + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: ByViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StartDate +Start Date + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.md b/swaggerci/cost-management/docs/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.md new file mode 100644 index 000000000000..e0211f2df97a --- /dev/null +++ b/swaggerci/cost-management/docs/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.md @@ -0,0 +1,246 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostbygeneratereservationdetailreportbillingprofileid +schema: 2.0.0 +--- + +# Invoke-AzCostByGenerateReservationDetailReportBillingProfileId + +## SYNOPSIS +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 + +## SYNTAX + +### By (Default) +``` +Invoke-AzCostByGenerateReservationDetailReportBillingProfileId -BillingAccountId + -BillingProfileId -EndDate -StartDate [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### ByViaIdentity +``` +Invoke-AzCostByGenerateReservationDetailReportBillingProfileId -InputObject -EndDate + -StartDate [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## 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 + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingAccountId +BillingAccount ID + +```yaml +Type: System.String +Parameter Sets: By +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingProfileId +BillingProfile ID + +```yaml +Type: System.String +Parameter Sets: By +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EndDate +End Date + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: ByViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StartDate +Start Date + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Invoke-AzCostCloudForecast.md b/swaggerci/cost-management/docs/Invoke-AzCostCloudForecast.md new file mode 100644 index 000000000000..75cd0b57f910 --- /dev/null +++ b/swaggerci/cost-management/docs/Invoke-AzCostCloudForecast.md @@ -0,0 +1,496 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostcloudforecast +schema: 2.0.0 +--- + +# Invoke-AzCostCloudForecast + +## SYNOPSIS +Lists the forecast charges for external cloud provider type defined. + +## SYNTAX + +### CloudExpanded (Default) +``` +Invoke-AzCostCloudForecast -ExternalCloudProviderId + -ExternalCloudProviderType -DatasetAggregation -Type + [-Filter ] [-ConfigurationColumn ] [-DatasetGranularity ] + [-DimensionName ] [-DimensionValue ] [-FilterAnd ] + [-FilterOr ] [-IncludeActualCost] [-IncludeFreshPartialCost] [-TagName ] + [-TagValue ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### Cloud +``` +Invoke-AzCostCloudForecast -ExternalCloudProviderId + -ExternalCloudProviderType -Parameter [-Filter ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CloudViaIdentity +``` +Invoke-AzCostCloudForecast -InputObject -Parameter [-Filter ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CloudViaIdentityExpanded +``` +Invoke-AzCostCloudForecast -InputObject -DatasetAggregation -Type + [-Filter ] [-ConfigurationColumn ] [-DatasetGranularity ] + [-DimensionName ] [-DimensionValue ] [-FilterAnd ] + [-FilterOr ] [-IncludeActualCost] [-IncludeFreshPartialCost] [-TagName ] + [-TagValue ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Lists the forecast charges for external cloud provider type defined. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ConfigurationColumn +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. + +```yaml +Type: System.String[] +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetAggregation +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. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGranularity +The granularity of rows in the forecast. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DimensionName +The name of the column to use in comparison. + +```yaml +Type: System.String +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DimensionValue +Array of values to use for comparison + +```yaml +Type: System.String[] +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderId +This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + +```yaml +Type: System.String +Parameter Sets: Cloud, CloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderType +The external cloud provider type associated with dimension/query operations. +This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType +Parameter Sets: Cloud, CloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. +The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +It does not currently support 'ne', 'or', or 'not'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAnd +The logical "AND" expression. +Must have at least 2 items. +To construct, see NOTES section for FILTERAND properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterOr +The logical "OR" expression. +Must have at least 2 items. +To construct, see NOTES section for FILTEROR properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IncludeActualCost +A boolean determining if actualCost will be included. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IncludeFreshPartialCost +A boolean determining if FreshPartialCost will be included. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: CloudViaIdentity, CloudViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Parameter +The definition of a forecast. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition +Parameter Sets: Cloud, CloudViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -TagName +The name of the column to use in comparison. + +```yaml +Type: System.String +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TagValue +Array of values to use for comparison + +```yaml +Type: System.String[] +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodFrom +The start date to pull data from. + +```yaml +Type: System.DateTime +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodTo +The end date to pull data to. + +```yaml +Type: System.DateTime +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +The type of the forecast. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType +Parameter Sets: CloudExpanded, CloudViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult + +## NOTES + +ALIASES + +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. + + +`FILTERAND `: The logical "AND" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + +`FILTEROR `: The logical "OR" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +`PARAMETER `: The definition of a forecast. + - `DatasetAggregation `: 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. + - `[(Any) ]`: This indicates any property can be added to this object. + - `Type `: The type of the forecast. + - `[ConfigurationColumn ]`: 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. + - `[DatasetGranularity ]`: The granularity of rows in the forecast. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[FilterAnd ]`: The logical "AND" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[FilterOr ]`: The logical "OR" expression. Must have at least 2 items. + - `[IncludeActualCost ]`: A boolean determining if actualCost will be included. + - `[IncludeFreshPartialCost ]`: A boolean determining if FreshPartialCost will be included. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[TimePeriodFrom ]`: The start date to pull data from. + - `[TimePeriodTo ]`: The end date to pull data to. + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Invoke-AzCostDismissAlert.md b/swaggerci/cost-management/docs/Invoke-AzCostDismissAlert.md new file mode 100644 index 000000000000..6a9c0c9d07a2 --- /dev/null +++ b/swaggerci/cost-management/docs/Invoke-AzCostDismissAlert.md @@ -0,0 +1,780 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostdismissalert +schema: 2.0.0 +--- + +# Invoke-AzCostDismissAlert + +## SYNOPSIS +Dismisses the specified alert + +## SYNTAX + +### DismissExpanded (Default) +``` +Invoke-AzCostDismissAlert -AlertId -Scope [-CloseTime ] [-CostEntityId ] + [-CreationTime ] [-DefinitionCategory ] [-DefinitionCriterion ] + [-DefinitionType ] [-Description ] [-DetailAmount ] [-DetailCompanyName ] + [-DetailContactEmail ] [-DetailContactGroup ] [-DetailContactRole ] + [-DetailCurrentSpend ] [-DetailDepartmentName ] [-DetailEnrollmentEndDate ] + [-DetailEnrollmentNumber ] [-DetailEnrollmentStartDate ] + [-DetailInvoicingThreshold ] [-DetailMeterFilter ] [-DetailOperator ] + [-DetailOverridingAlert ] [-DetailPeriodStartDate ] [-DetailResourceFilter ] + [-DetailResourceGroupFilter ] [-DetailTagFilter ] [-DetailThreshold ] + [-DetailTimeGrainType ] [-DetailTriggeredBy ] [-DetailUnit ] + [-ModificationTime ] [-Source ] [-Status ] + [-StatusModificationTime ] [-StatusModificationUserName ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### Dismiss +``` +Invoke-AzCostDismissAlert -AlertId -Scope -Parameter + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### DismissViaIdentity +``` +Invoke-AzCostDismissAlert -InputObject -Parameter + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### DismissViaIdentityExpanded +``` +Invoke-AzCostDismissAlert -InputObject [-CloseTime ] [-CostEntityId ] + [-CreationTime ] [-DefinitionCategory ] [-DefinitionCriterion ] + [-DefinitionType ] [-Description ] [-DetailAmount ] [-DetailCompanyName ] + [-DetailContactEmail ] [-DetailContactGroup ] [-DetailContactRole ] + [-DetailCurrentSpend ] [-DetailDepartmentName ] [-DetailEnrollmentEndDate ] + [-DetailEnrollmentNumber ] [-DetailEnrollmentStartDate ] + [-DetailInvoicingThreshold ] [-DetailMeterFilter ] [-DetailOperator ] + [-DetailOverridingAlert ] [-DetailPeriodStartDate ] [-DetailResourceFilter ] + [-DetailResourceGroupFilter ] [-DetailTagFilter ] [-DetailThreshold ] + [-DetailTimeGrainType ] [-DetailTriggeredBy ] [-DetailUnit ] + [-ModificationTime ] [-Source ] [-Status ] + [-StatusModificationTime ] [-StatusModificationUserName ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Dismisses the specified alert + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AlertId +Alert ID + +```yaml +Type: System.String +Parameter Sets: Dismiss, DismissExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CloseTime +dateTime in which alert was closed + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CostEntityId +related budget + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CreationTime +dateTime in which alert was created + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionCategory +Alert category + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionCriterion +Criteria that triggered alert + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionType +type of alert + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Description +Alert description + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailAmount +budget threshold amount + +```yaml +Type: System.Decimal +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailCompanyName +company name + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailContactEmail +list of emails to contact + +```yaml +Type: System.String[] +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailContactGroup +list of action groups to broadcast to + +```yaml +Type: System.String[] +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailContactRole +list of contact roles + +```yaml +Type: System.String[] +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailCurrentSpend +current spend + +```yaml +Type: System.Decimal +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailDepartmentName +department name + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailEnrollmentEndDate +datetime of enrollmentEndDate + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailEnrollmentNumber +enrollment number + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailEnrollmentStartDate +datetime of enrollmentStartDate + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailInvoicingThreshold +invoicing threshold + +```yaml +Type: System.Decimal +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailMeterFilter +array of meters to filter by + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailOperator +operator used to compare currentSpend with amount + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailOverridingAlert +overriding alert + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailPeriodStartDate +datetime of periodStartDate + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailResourceFilter +array of resources to filter by + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailResourceGroupFilter +array of resourceGroups to filter by + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailTagFilter +tags to filter by + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailThreshold +notification threshold percentage as a decimal which activated this alert + +```yaml +Type: System.Decimal +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailTimeGrainType +Type of timegrain cadence + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailTriggeredBy +notificationId that triggered this alert + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DetailUnit +unit of currency being used + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: DismissViaIdentity, DismissViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ModificationTime +dateTime in which alert was last modified + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +The request payload to update an alert +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload +Parameter Sets: Dismiss, DismissViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Scope +The scope associated with alerts operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: Dismiss, DismissExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Source +Source of alert + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Status +alert status + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StatusModificationTime +dateTime in which the alert status was last modified + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StatusModificationUserName +User who last modified the alert + +```yaml +Type: System.String +Parameter Sets: DismissExpanded, DismissViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +`PARAMETER `: The request payload to update an alert + - `[CloseTime ]`: dateTime in which alert was closed + - `[CostEntityId ]`: related budget + - `[CreationTime ]`: dateTime in which alert was created + - `[DefinitionCategory ]`: Alert category + - `[DefinitionCriterion ]`: Criteria that triggered alert + - `[DefinitionType ]`: type of alert + - `[Description ]`: Alert description + - `[DetailAmount ]`: budget threshold amount + - `[DetailCompanyName ]`: company name + - `[DetailContactEmail ]`: list of emails to contact + - `[DetailContactGroup ]`: list of action groups to broadcast to + - `[DetailContactRole ]`: list of contact roles + - `[DetailCurrentSpend ]`: current spend + - `[DetailDepartmentName ]`: department name + - `[DetailEnrollmentEndDate ]`: datetime of enrollmentEndDate + - `[DetailEnrollmentNumber ]`: enrollment number + - `[DetailEnrollmentStartDate ]`: datetime of enrollmentStartDate + - `[DetailInvoicingThreshold ]`: invoicing threshold + - `[DetailMeterFilter ]`: array of meters to filter by + - `[DetailOperator ]`: operator used to compare currentSpend with amount + - `[DetailOverridingAlert ]`: overriding alert + - `[DetailPeriodStartDate ]`: datetime of periodStartDate + - `[DetailResourceFilter ]`: array of resources to filter by + - `[DetailResourceGroupFilter ]`: array of resourceGroups to filter by + - `[DetailTagFilter ]`: tags to filter by + - `[DetailThreshold ]`: notification threshold percentage as a decimal which activated this alert + - `[DetailTimeGrainType ]`: Type of timegrain cadence + - `[DetailTriggeredBy ]`: notificationId that triggered this alert + - `[DetailUnit ]`: unit of currency being used + - `[ModificationTime ]`: dateTime in which alert was last modified + - `[Source ]`: Source of alert + - `[Status ]`: alert status + - `[StatusModificationTime ]`: dateTime in which the alert status was last modified + - `[StatusModificationUserName ]`: User who last modified the alert + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Invoke-AzCostExecuteExport.md b/swaggerci/cost-management/docs/Invoke-AzCostExecuteExport.md new file mode 100644 index 000000000000..60f271852506 --- /dev/null +++ b/swaggerci/cost-management/docs/Invoke-AzCostExecuteExport.md @@ -0,0 +1,197 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostexecuteexport +schema: 2.0.0 +--- + +# Invoke-AzCostExecuteExport + +## SYNOPSIS +The operation to execute an export. + +## SYNTAX + +### Execute (Default) +``` +Invoke-AzCostExecuteExport -ExportName -Scope [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### ExecuteViaIdentity +``` +Invoke-AzCostExecuteExport -InputObject [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +The operation to execute an export. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExportName +Export Name. + +```yaml +Type: System.String +Parameter Sets: Execute +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: ExecuteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Execute +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Invoke-AzCostUsageForecast.md b/swaggerci/cost-management/docs/Invoke-AzCostUsageForecast.md new file mode 100644 index 000000000000..c84968c8fa10 --- /dev/null +++ b/swaggerci/cost-management/docs/Invoke-AzCostUsageForecast.md @@ -0,0 +1,494 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostusageforecast +schema: 2.0.0 +--- + +# Invoke-AzCostUsageForecast + +## SYNOPSIS +Lists the forecast charges for scope defined. + +## SYNTAX + +### UsageExpanded (Default) +``` +Invoke-AzCostUsageForecast -Scope -DatasetAggregation -Type + [-Filter ] [-ConfigurationColumn ] [-DatasetGranularity ] + [-DimensionName ] [-DimensionValue ] [-FilterAnd ] + [-FilterOr ] [-IncludeActualCost] [-IncludeFreshPartialCost] [-TagName ] + [-TagValue ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Usage +``` +Invoke-AzCostUsageForecast -Scope -Parameter [-Filter ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### UsageViaIdentity +``` +Invoke-AzCostUsageForecast -InputObject -Parameter [-Filter ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### UsageViaIdentityExpanded +``` +Invoke-AzCostUsageForecast -InputObject -DatasetAggregation -Type + [-Filter ] [-ConfigurationColumn ] [-DatasetGranularity ] + [-DimensionName ] [-DimensionValue ] [-FilterAnd ] + [-FilterOr ] [-IncludeActualCost] [-IncludeFreshPartialCost] [-TagName ] + [-TagValue ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Lists the forecast charges for scope defined. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ConfigurationColumn +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. + +```yaml +Type: System.String[] +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetAggregation +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. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGranularity +The granularity of rows in the forecast. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DimensionName +The name of the column to use in comparison. + +```yaml +Type: System.String +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DimensionValue +Array of values to use for comparison + +```yaml +Type: System.String[] +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. +The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +It does not currently support 'ne', 'or', or 'not'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAnd +The logical "AND" expression. +Must have at least 2 items. +To construct, see NOTES section for FILTERAND properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterOr +The logical "OR" expression. +Must have at least 2 items. +To construct, see NOTES section for FILTEROR properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IncludeActualCost +A boolean determining if actualCost will be included. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IncludeFreshPartialCost +A boolean determining if FreshPartialCost will be included. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: UsageViaIdentity, UsageViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Parameter +The definition of a forecast. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition +Parameter Sets: Usage, UsageViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with forecast operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: Usage, UsageExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TagName +The name of the column to use in comparison. + +```yaml +Type: System.String +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TagValue +Array of values to use for comparison + +```yaml +Type: System.String[] +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodFrom +The start date to pull data from. + +```yaml +Type: System.DateTime +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodTo +The end date to pull data to. + +```yaml +Type: System.DateTime +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +The type of the forecast. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType +Parameter Sets: UsageExpanded, UsageViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult + +## NOTES + +ALIASES + +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. + + +`FILTERAND `: The logical "AND" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + +`FILTEROR `: The logical "OR" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +`PARAMETER `: The definition of a forecast. + - `DatasetAggregation `: 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. + - `[(Any) ]`: This indicates any property can be added to this object. + - `Type `: The type of the forecast. + - `[ConfigurationColumn ]`: 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. + - `[DatasetGranularity ]`: The granularity of rows in the forecast. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[FilterAnd ]`: The logical "AND" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[FilterOr ]`: The logical "OR" expression. Must have at least 2 items. + - `[IncludeActualCost ]`: A boolean determining if actualCost will be included. + - `[IncludeFreshPartialCost ]`: A boolean determining if FreshPartialCost will be included. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[TimePeriodFrom ]`: The start date to pull data from. + - `[TimePeriodTo ]`: The end date to pull data to. + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Invoke-AzCostUsageQuery.md b/swaggerci/cost-management/docs/Invoke-AzCostUsageQuery.md new file mode 100644 index 000000000000..81e61358d9fc --- /dev/null +++ b/swaggerci/cost-management/docs/Invoke-AzCostUsageQuery.md @@ -0,0 +1,551 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostusagequery +schema: 2.0.0 +--- + +# Invoke-AzCostUsageQuery + +## SYNOPSIS +Query the usage data for scope defined. + +## SYNTAX + +### UsageExpanded (Default) +``` +Invoke-AzCostUsageQuery -Scope -Timeframe -Type + [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetGranularity ] + [-DatasetGrouping ] [-DimensionName ] [-DimensionValue ] + [-FilterAnd ] [-FilterOr ] [-TagName ] [-TagValue ] + [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### Usage +``` +Invoke-AzCostUsageQuery -Scope -Parameter [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### Usage1 +``` +Invoke-AzCostUsageQuery -ExternalCloudProviderId + -ExternalCloudProviderType -Parameter + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UsageExpanded1 +``` +Invoke-AzCostUsageQuery -ExternalCloudProviderId + -ExternalCloudProviderType -Timeframe -Type + [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetGranularity ] + [-DatasetGrouping ] [-DimensionName ] [-DimensionValue ] + [-FilterAnd ] [-FilterOr ] [-TagName ] [-TagValue ] + [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### UsageViaIdentity +``` +Invoke-AzCostUsageQuery -InputObject -Parameter + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### UsageViaIdentity1 +``` +Invoke-AzCostUsageQuery -InputObject -Parameter + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UsageViaIdentityExpanded +``` +Invoke-AzCostUsageQuery -InputObject -Timeframe -Type + [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetGranularity ] + [-DatasetGrouping ] [-DimensionName ] [-DimensionValue ] + [-FilterAnd ] [-FilterOr ] [-TagName ] [-TagValue ] + [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### UsageViaIdentityExpanded1 +``` +Invoke-AzCostUsageQuery -InputObject -Timeframe -Type + [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetGranularity ] + [-DatasetGrouping ] [-DimensionName ] [-DimensionValue ] + [-FilterAnd ] [-FilterOr ] [-TagName ] [-TagValue ] + [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Query the usage data for scope defined. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ConfigurationColumn +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. + +```yaml +Type: System.String[] +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetAggregation +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. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGranularity +The granularity of rows in the query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGrouping +Array of group by expression to use in the query. +Query can have up to 2 group by clauses. +To construct, see NOTES section for DATASETGROUPING properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DimensionName +The name of the column to use in comparison. + +```yaml +Type: System.String +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DimensionValue +Array of values to use for comparison + +```yaml +Type: System.String[] +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderId +This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + +```yaml +Type: System.String +Parameter Sets: Usage1, UsageExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderType +The external cloud provider type associated with dimension/query operations. +This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType +Parameter Sets: Usage1, UsageExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterAnd +The logical "AND" expression. +Must have at least 2 items. +To construct, see NOTES section for FILTERAND properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FilterOr +The logical "OR" expression. +Must have at least 2 items. +To construct, see NOTES section for FILTEROR properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: UsageViaIdentity, UsageViaIdentity1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Parameter +The definition of a query. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition +Parameter Sets: Usage, Usage1, UsageViaIdentity, UsageViaIdentity1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: Usage, UsageExpanded, UsageViaIdentity, UsageViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with query and export operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: Usage, UsageExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TagName +The name of the column to use in comparison. + +```yaml +Type: System.String +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TagValue +Array of values to use for comparison + +```yaml +Type: System.String[] +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Timeframe +The time frame for pulling data for the query. +If custom, then a specific time period must be provided. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodFrom +The start date to pull data from. + +```yaml +Type: System.DateTime +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodTo +The end date to pull data to. + +```yaml +Type: System.DateTime +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +The type of the query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType +Parameter Sets: UsageExpanded, UsageExpanded1, UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult + +## NOTES + +ALIASES + +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. + + +`DATASETGROUPING `: Array of group by expression to use in the query. Query can have up to 2 group by clauses. + - `Name `: The name of the column to group. + - `Type `: Has type of the column to group. + +`FILTERAND `: The logical "AND" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + +`FILTEROR `: The logical "OR" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +`PARAMETER `: The definition of a query. + - `Timeframe `: The time frame for pulling data for the query. If custom, then a specific time period must be provided. + - `Type `: The type of the query. + - `[ConfigurationColumn ]`: 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. + - `[DatasetAggregation ]`: 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. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[DatasetGranularity ]`: The granularity of rows in the query. + - `[DatasetGrouping ]`: Array of group by expression to use in the query. Query can have up to 2 group by clauses. + - `Name `: The name of the column to group. + - `Type `: Has type of the column to group. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[FilterAnd ]`: The logical "AND" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[FilterOr ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[TimePeriodFrom ]`: The start date to pull data from. + - `[TimePeriodTo ]`: The end date to pull data to. + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/New-AzCostExport.md b/swaggerci/cost-management/docs/New-AzCostExport.md new file mode 100644 index 000000000000..2e7ace3cf3d5 --- /dev/null +++ b/swaggerci/cost-management/docs/New-AzCostExport.md @@ -0,0 +1,435 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostexport +schema: 2.0.0 +--- + +# New-AzCostExport + +## SYNOPSIS +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. + +## SYNTAX + +``` +New-AzCostExport -Name -Scope [-ConfigurationColumn ] + [-DataSetGranularity ] [-DefinitionTimeframe ] [-DefinitionType ] + [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] + [-DestinationSasToken ] [-DestinationStorageAccount ] [-ETag ] [-Format ] + [-PartitionData] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] + [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## 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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ConfigurationColumn +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). + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DataSetGranularity +The granularity of rows in the export. +Currently only 'Daily' is supported. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionTimeframe +The time frame for pulling data for the export. +If custom, then a specific time period must be provided. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionType +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. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationContainer +The name of the container where exports will be uploaded. +If the container does not exist it will be created. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationResourceId +The resource id of the storage account where exports will be delivered. +This is not required if a sasToken and storageAccount are specified. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationRootFolderPath +The name of the directory where exports will be uploaded. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationSasToken +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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationStorageAccount +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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ETag +eTag of the resource. +To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Format +The format of the export being delivered. +Currently only 'Csv' is supported. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Export Name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ExportName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartitionData +If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file. +Note: this option is currently available only for modern commerce scopes. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RecurrencePeriodFrom +The start date of recurrence. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RecurrencePeriodTo +The end date of recurrence. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScheduleRecurrence +The schedule recurrence. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScheduleStatus +The status of the export's schedule. +If 'Inactive', the export's schedule is paused. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodFrom +The start date for export data. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodTo +The end date for export data. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/New-AzCostGenerateCostDetailReportOperation.md b/swaggerci/cost-management/docs/New-AzCostGenerateCostDetailReportOperation.md new file mode 100644 index 000000000000..1cbb520ae2b1 --- /dev/null +++ b/swaggerci/cost-management/docs/New-AzCostGenerateCostDetailReportOperation.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostgeneratecostdetailreportoperation +schema: 2.0.0 +--- + +# New-AzCostGenerateCostDetailReportOperation + +## SYNOPSIS +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. + +## SYNTAX + +``` +New-AzCostGenerateCostDetailReportOperation -Scope [-BillingPeriod ] [-InvoiceId ] + [-Metric ] [-TimePeriodEnd ] [-TimePeriodStart ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## 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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingPeriod +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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InvoiceId +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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Metric +The type of the detailed report. +By default ActualCost is provided + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodEnd +The end date to pull data to. +example format 2020-03-15 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodStart +The start date to pull data from. +example format 2020-03-15 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/New-AzCostGenerateDetailedCostReportOperation.md b/swaggerci/cost-management/docs/New-AzCostGenerateDetailedCostReportOperation.md new file mode 100644 index 000000000000..e09f5cddc492 --- /dev/null +++ b/swaggerci/cost-management/docs/New-AzCostGenerateDetailedCostReportOperation.md @@ -0,0 +1,261 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostgeneratedetailedcostreportoperation +schema: 2.0.0 +--- + +# New-AzCostGenerateDetailedCostReportOperation + +## SYNOPSIS +Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. +Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. +A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored. + +## SYNTAX + +``` +New-AzCostGenerateDetailedCostReportOperation -Scope [-BillingPeriod ] [-CustomerId ] + [-InvoiceId ] [-Metric ] [-TimePeriodEnd ] + [-TimePeriodStart ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. +Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. +A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BillingPeriod +Billing Period in YearMonth(e.g. +202008) format. +Only for legacy enterprise customers can use this. +Can only have one of either timePeriod or invoiceId or billingPeriod parameters. +If none provided current month cost is provided. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CustomerId +Customer Id for Modern (Invoice Id and billing profile is also required for this). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InvoiceId +Invoice Id for PayAsYouGo customers and Modern billing profile scope. +Can only have one of either timePeriod or invoiceId or billingPeriod parameters. +If none provided current month cost is provided. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Metric +The type of the detailed report. +By default ActualCost is provided + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodEnd +The end date to pull data to. +example format 2020-03-15 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodStart +The start date to pull data from. +example format 2020-03-15 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/New-AzCostView.md b/swaggerci/cost-management/docs/New-AzCostView.md new file mode 100644 index 000000000000..93cafc748267 --- /dev/null +++ b/swaggerci/cost-management/docs/New-AzCostView.md @@ -0,0 +1,460 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostview +schema: 2.0.0 +--- + +# New-AzCostView + +## SYNOPSIS +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. + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzCostView -Name [-Scope ] [-Accumulated ] [-Chart ] + [-DisplayName ] [-ETag ] [-Kpi ] [-Metric ] + [-Pivot ] [-Query ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### Create1 +``` +New-AzCostView -Name -Scope -Parameter [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### CreateExpanded1 +``` +New-AzCostView -Name -Scope [-Accumulated ] [-Chart ] + [-DisplayName ] [-ETag ] [-Kpi ] [-Metric ] + [-Pivot ] [-PropertiesScope ] [-Query ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentity1 +``` +New-AzCostView -InputObject -Parameter [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### CreateViaIdentityExpanded1 +``` +New-AzCostView -InputObject [-Scope ] [-Accumulated ] + [-Chart ] [-DisplayName ] [-ETag ] [-Kpi ] + [-Metric ] [-Pivot ] [-Query ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +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. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -Accumulated +Show costs accumulated over time. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType +Parameter Sets: CreateExpanded, CreateExpanded1, CreateViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Chart +Chart type of the main view in Cost Analysis. +Required. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType +Parameter Sets: CreateExpanded, CreateExpanded1, CreateViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisplayName +User input name of the view. +Required. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateExpanded1, CreateViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ETag +eTag of the resource. +To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateExpanded1, CreateViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: CreateViaIdentity1, CreateViaIdentityExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Kpi +List of KPIs to show in Cost Analysis UI. +To construct, see NOTES section for KPI properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[] +Parameter Sets: CreateExpanded, CreateExpanded1, CreateViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Metric +Metric to use when displaying costs. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType +Parameter Sets: CreateExpanded, CreateExpanded1, CreateViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +View name + +```yaml +Type: System.String +Parameter Sets: Create1, CreateExpanded, CreateExpanded1 +Aliases: ViewName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +States and configurations of Cost Analysis. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView +Parameter Sets: Create1, CreateViaIdentity1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Pivot +Configuration of 3 sub-views in the Cost Analysis UI. +To construct, see NOTES section for PIVOT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[] +Parameter Sets: CreateExpanded, CreateExpanded1, CreateViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesScope +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. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Query +Query body configuration. +Required. +To construct, see NOTES section for QUERY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition +Parameter Sets: CreateExpanded, CreateExpanded1, CreateViaIdentityExpanded1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Create1, CreateExpanded, CreateExpanded1, CreateViaIdentityExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +`KPI `: List of KPIs to show in Cost Analysis UI. + - `[Enabled ]`: show the KPI in the UI? + - `[Id ]`: ID of resource related to metric (budget). + - `[Type ]`: KPI type (Forecast, Budget). + +`PARAMETER `: States and configurations of Cost Analysis. + - `[ETag ]`: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + - `[Accumulated ]`: Show costs accumulated over time. + - `[Chart ]`: Chart type of the main view in Cost Analysis. Required. + - `[DisplayName ]`: User input name of the view. Required. + - `[Kpi ]`: List of KPIs to show in Cost Analysis UI. + - `[Enabled ]`: show the KPI in the UI? + - `[Id ]`: ID of resource related to metric (budget). + - `[Type ]`: KPI type (Forecast, Budget). + - `[Metric ]`: Metric to use when displaying costs. + - `[Pivot ]`: Configuration of 3 sub-views in the Cost Analysis UI. + - `[Name ]`: Data field to show in view. + - `[Type ]`: Data type to show in view. + - `[Query ]`: Query body configuration. Required. + - `Timeframe `: The time frame for pulling data for the report. If custom, then a specific time period must be provided. + - `[ConfigurationColumn ]`: 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. + - `[DataSetAggregation ]`: 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. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[DataSetGranularity ]`: The granularity of rows in the report. + - `[DataSetGrouping ]`: Array of group by expression to use in the report. Report can have up to 2 group by clauses. + - `Name `: The name of the column to group. This version supports subscription lowest possible grain. + - `Type `: Has type of the column to group. + - `[DataSetSorting ]`: Array of order by expression to use in the report. + - `Name `: The name of the column to sort. + - `[Direction ]`: Direction of sort. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionOperator ]`: The operator to use for comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[FilterAnd ]`: The logical "AND" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionOperator ]`: The operator to use for comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagOperator ]`: The operator to use for comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[FilterOr ]`: The logical "OR" expression. Must have at least 2 items. + - `[IncludeMonetaryCommitment ]`: If true, report includes monetary commitment. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagOperator ]`: The operator to use for comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[TimePeriodFrom ]`: The start date to pull data from. + - `[TimePeriodTo ]`: The end date to pull data to. + - `[Scope ]`: 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. + +`PIVOT `: Configuration of 3 sub-views in the Cost Analysis UI. + - `[Name ]`: Data field to show in view. + - `[Type ]`: Data type to show in view. + +`QUERY `: Query body configuration. Required. + - `Timeframe `: The time frame for pulling data for the report. If custom, then a specific time period must be provided. + - `[ConfigurationColumn ]`: 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. + - `[DataSetAggregation ]`: 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. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[DataSetGranularity ]`: The granularity of rows in the report. + - `[DataSetGrouping ]`: Array of group by expression to use in the report. Report can have up to 2 group by clauses. + - `Name `: The name of the column to group. This version supports subscription lowest possible grain. + - `Type `: Has type of the column to group. + - `[DataSetSorting ]`: Array of order by expression to use in the report. + - `Name `: The name of the column to sort. + - `[Direction ]`: Direction of sort. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionOperator ]`: The operator to use for comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[FilterAnd ]`: The logical "AND" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[DimensionName ]`: The name of the column to use in comparison. + - `[DimensionOperator ]`: The operator to use for comparison. + - `[DimensionValue ]`: Array of values to use for comparison + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagOperator ]`: The operator to use for comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[FilterOr ]`: The logical "OR" expression. Must have at least 2 items. + - `[IncludeMonetaryCommitment ]`: If true, report includes monetary commitment. + - `[TagName ]`: The name of the column to use in comparison. + - `[TagOperator ]`: The operator to use for comparison. + - `[TagValue ]`: Array of values to use for comparison + - `[TimePeriodFrom ]`: The start date to pull data from. + - `[TimePeriodTo ]`: The end date to pull data to. + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/README.md b/swaggerci/cost-management/docs/README.md new file mode 100644 index 000000000000..0edf1f6014fb --- /dev/null +++ b/swaggerci/cost-management/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.Cost` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.Cost` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file diff --git a/swaggerci/cost-management/docs/Remove-AzCostExport.md b/swaggerci/cost-management/docs/Remove-AzCostExport.md new file mode 100644 index 000000000000..61c69ccbb042 --- /dev/null +++ b/swaggerci/cost-management/docs/Remove-AzCostExport.md @@ -0,0 +1,197 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/remove-azcostexport +schema: 2.0.0 +--- + +# Remove-AzCostExport + +## SYNOPSIS +The operation to delete a export. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzCostExport -Name -Scope [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzCostExport -InputObject [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +The operation to delete a export. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Export Name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ExportName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/docs/Remove-AzCostView.md b/swaggerci/cost-management/docs/Remove-AzCostView.md new file mode 100644 index 000000000000..91f1455b1941 --- /dev/null +++ b/swaggerci/cost-management/docs/Remove-AzCostView.md @@ -0,0 +1,209 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/remove-azcostview +schema: 2.0.0 +--- + +# Remove-AzCostView + +## SYNOPSIS +The operation to delete a view. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzCostView -Name [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### Delete1 +``` +Remove-AzCostView -Name -Scope [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzCostView -InputObject [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity1 +``` +Remove-AzCostView -InputObject [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +The operation to delete a view. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: DeleteViaIdentity, DeleteViaIdentity1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +View name + +```yaml +Type: System.String +Parameter Sets: Delete, Delete1 +Aliases: ViewName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -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. + +```yaml +Type: System.String +Parameter Sets: Delete1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +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. + + +`INPUTOBJECT `: Identity Parameter + - `[AlertId ]`: Alert ID + - `[BillingAccountId ]`: Enrollment ID (Legacy BillingAccount ID) + - `[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. + - `[Id ]`: Resource identity path + - `[OperationId ]`: The target operation Id. + - `[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. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/swaggerci/cost-management/examples/Get-AzCostAlert.md b/swaggerci/cost-management/examples/Get-AzCostAlert.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Get-AzCostAlert.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Get-AzCostAlertExternal.md b/swaggerci/cost-management/examples/Get-AzCostAlertExternal.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Get-AzCostAlertExternal.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Get-AzCostDimension.md b/swaggerci/cost-management/examples/Get-AzCostDimension.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Get-AzCostDimension.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Get-AzCostExport.md b/swaggerci/cost-management/examples/Get-AzCostExport.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Get-AzCostExport.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Get-AzCostExportExecutionHistory.md b/swaggerci/cost-management/examples/Get-AzCostExportExecutionHistory.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Get-AzCostExportExecutionHistory.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Get-AzCostGenerateCostDetailReportOperationResult.md b/swaggerci/cost-management/examples/Get-AzCostGenerateCostDetailReportOperationResult.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Get-AzCostGenerateCostDetailReportOperationResult.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Get-AzCostGenerateDetailedCostReportOperationResult.md b/swaggerci/cost-management/examples/Get-AzCostGenerateDetailedCostReportOperationResult.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Get-AzCostGenerateDetailedCostReportOperationResult.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Get-AzCostGenerateDetailedCostReportOperationStatus.md b/swaggerci/cost-management/examples/Get-AzCostGenerateDetailedCostReportOperationStatus.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Get-AzCostGenerateDetailedCostReportOperationStatus.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Get-AzCostView.md b/swaggerci/cost-management/examples/Get-AzCostView.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Get-AzCostView.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Invoke-AzCostByDimensionExternalCloudProviderType.md b/swaggerci/cost-management/examples/Invoke-AzCostByDimensionExternalCloudProviderType.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Invoke-AzCostByDimensionExternalCloudProviderType.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.md b/swaggerci/cost-management/examples/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.md b/swaggerci/cost-management/examples/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Invoke-AzCostCloudForecast.md b/swaggerci/cost-management/examples/Invoke-AzCostCloudForecast.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Invoke-AzCostCloudForecast.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Invoke-AzCostDismissAlert.md b/swaggerci/cost-management/examples/Invoke-AzCostDismissAlert.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Invoke-AzCostDismissAlert.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Invoke-AzCostExecuteExport.md b/swaggerci/cost-management/examples/Invoke-AzCostExecuteExport.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Invoke-AzCostExecuteExport.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Invoke-AzCostUsageForecast.md b/swaggerci/cost-management/examples/Invoke-AzCostUsageForecast.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Invoke-AzCostUsageForecast.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Invoke-AzCostUsageQuery.md b/swaggerci/cost-management/examples/Invoke-AzCostUsageQuery.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Invoke-AzCostUsageQuery.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/New-AzCostExport.md b/swaggerci/cost-management/examples/New-AzCostExport.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/New-AzCostExport.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/New-AzCostGenerateCostDetailReportOperation.md b/swaggerci/cost-management/examples/New-AzCostGenerateCostDetailReportOperation.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/New-AzCostGenerateCostDetailReportOperation.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/New-AzCostGenerateDetailedCostReportOperation.md b/swaggerci/cost-management/examples/New-AzCostGenerateDetailedCostReportOperation.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/New-AzCostGenerateDetailedCostReportOperation.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/New-AzCostView.md b/swaggerci/cost-management/examples/New-AzCostView.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/New-AzCostView.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Remove-AzCostExport.md b/swaggerci/cost-management/examples/Remove-AzCostExport.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Remove-AzCostExport.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/examples/Remove-AzCostView.md b/swaggerci/cost-management/examples/Remove-AzCostView.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/cost-management/examples/Remove-AzCostView.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/cost-management/export-surface.ps1 b/swaggerci/cost-management/export-surface.ps1 new file mode 100644 index 000000000000..f0b353f94fe2 --- /dev/null +++ b/swaggerci/cost-management/export-surface.ps1 @@ -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. +# 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]$IncludeGeneralParameters, [switch]$UseExpandedFormat) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.Cost.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} +$null = Import-Module -Name $dll + +$moduleName = 'Az.Cost' +$exportsFolder = Join-Path $PSScriptRoot 'exports' +$resourcesFolder = Join-Path $PSScriptRoot 'resources' + +Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'" + +Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'" + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/cost-management/exports/Get-AzCostAlert.ps1 b/swaggerci/cost-management/exports/Get-AzCostAlert.ps1 new file mode 100644 index 000000000000..b0d47c300f59 --- /dev/null +++ b/swaggerci/cost-management/exports/Get-AzCostAlert.ps1 @@ -0,0 +1,192 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the alert for the scope by alert ID. +.Description +Gets the alert for the scope by alert ID. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostalert +#> +function Get-AzCostAlert { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert], [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AlertId')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Alert ID + ${Id}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostAlert_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostAlert_GetViaIdentity'; + List = 'Az.Cost.private\Get-AzCostAlert_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Get-AzCostAlertExternal.ps1 b/swaggerci/cost-management/exports/Get-AzCostAlertExternal.ps1 new file mode 100644 index 000000000000..6aa2c3c0e50b --- /dev/null +++ b/swaggerci/cost-management/exports/Get-AzCostAlertExternal.ps1 @@ -0,0 +1,162 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the Alerts for external cloud provider type defined. +.Description +Lists the Alerts for external cloud provider type defined. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostalertexternal +#> +function Get-AzCostAlertExternal { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + ${ExternalCloudProviderId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + # The external cloud provider type associated with dimension/query operations. + # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + ${ExternalCloudProviderType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Cost.private\Get-AzCostAlertExternal_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Get-AzCostDimension.ps1 b/swaggerci/cost-management/exports/Get-AzCostDimension.ps1 new file mode 100644 index 000000000000..77fd7c20ec20 --- /dev/null +++ b/swaggerci/cost-management/exports/Get-AzCostDimension.ps1 @@ -0,0 +1,188 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the dimensions by the defined scope. +.Description +Lists the dimensions by the defined scope. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostdimension +#> +function Get-AzCostDimension { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # May be used to expand the properties/data within a dimension category. + # By default, data is not included when listing dimensions. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + # Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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. + ${Skiptoken}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the most recent N dimension data. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Cost.private\Get-AzCostDimension_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Get-AzCostExport.ps1 b/swaggerci/cost-management/exports/Get-AzCostExport.ps1 new file mode 100644 index 000000000000..7fb54cd79ede --- /dev/null +++ b/swaggerci/cost-management/exports/Get-AzCostExport.ps1 @@ -0,0 +1,197 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The operation to get the export for the defined scope by export name. +.Description +The operation to get the export for the defined scope by export name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostexport +#> +function Get-AzCostExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ExportName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostExport_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostExport_GetViaIdentity'; + List = 'Az.Cost.private\Get-AzCostExport_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Get-AzCostExportExecutionHistory.ps1 b/swaggerci/cost-management/exports/Get-AzCostExportExecutionHistory.ps1 new file mode 100644 index 000000000000..637f018937da --- /dev/null +++ b/swaggerci/cost-management/exports/Get-AzCostExportExecutionHistory.ps1 @@ -0,0 +1,187 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The operation to get the execution history of an export for the defined scope and export name. +.Description +The operation to get the execution history of an export for the defined scope and export name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostexportexecutionhistory +#> +function Get-AzCostExportExecutionHistory { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${ExportName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostExportExecutionHistory_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostExportExecutionHistory_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Get-AzCostGenerateCostDetailReportOperationResult.ps1 b/swaggerci/cost-management/exports/Get-AzCostGenerateCostDetailReportOperationResult.ps1 new file mode 100644 index 000000000000..ff0c458ea28a --- /dev/null +++ b/swaggerci/cost-management/exports/Get-AzCostGenerateCostDetailReportOperationResult.ps1 @@ -0,0 +1,202 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the result of the specified operation. +This link is provided in the CostDetails creation request response Location header. +.Description +Get the result of the specified operation. +This link is provided in the CostDetails creation request response Location header. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostgeneratecostdetailreportoperationresult +#> +function Get-AzCostGenerateCostDetailReportOperationResult { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # The target operation Id. + ${OperationId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostGenerateCostDetailReportOperationResult_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostGenerateCostDetailReportOperationResult_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Get-AzCostGenerateDetailedCostReportOperationResult.ps1 b/swaggerci/cost-management/exports/Get-AzCostGenerateDetailedCostReportOperationResult.ps1 new file mode 100644 index 000000000000..f930d91a97b4 --- /dev/null +++ b/swaggerci/cost-management/exports/Get-AzCostGenerateDetailedCostReportOperationResult.ps1 @@ -0,0 +1,196 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the result of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. +.Description +Get the result of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostgeneratedetailedcostreportoperationresult +#> +function Get-AzCostGenerateDetailedCostReportOperationResult { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # The target operation Id. + ${OperationId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostGenerateDetailedCostReportOperationResult_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostGenerateDetailedCostReportOperationResult_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Get-AzCostGenerateDetailedCostReportOperationStatus.ps1 b/swaggerci/cost-management/exports/Get-AzCostGenerateDetailedCostReportOperationStatus.ps1 new file mode 100644 index 000000000000..33ca44f247d9 --- /dev/null +++ b/swaggerci/cost-management/exports/Get-AzCostGenerateDetailedCostReportOperationStatus.ps1 @@ -0,0 +1,190 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the status of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. +.Description +Get the status of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostgeneratedetailedcostreportoperationstatus +#> +function Get-AzCostGenerateDetailedCostReportOperationStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # The target operation Id. + ${OperationId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostGenerateDetailedCostReportOperationStatus_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostGenerateDetailedCostReportOperationStatus_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Get-AzCostView.ps1 b/swaggerci/cost-management/exports/Get-AzCostView.ps1 new file mode 100644 index 000000000000..4590cb12fc42 --- /dev/null +++ b/swaggerci/cost-management/exports/Get-AzCostView.ps1 @@ -0,0 +1,195 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the view by view name. +.Description +Gets the view by view name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostview +#> +function Get-AzCostView { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Alias('ViewName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # View name + ${Name}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostView_Get'; + Get1 = 'Az.Cost.private\Get-AzCostView_Get1'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostView_GetViaIdentity'; + GetViaIdentity1 = 'Az.Cost.private\Get-AzCostView_GetViaIdentity1'; + List = 'Az.Cost.private\Get-AzCostView_List'; + List1 = 'Az.Cost.private\Get-AzCostView_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Invoke-AzCostByDimensionExternalCloudProviderType.ps1 b/swaggerci/cost-management/exports/Invoke-AzCostByDimensionExternalCloudProviderType.ps1 new file mode 100644 index 000000000000..a074e13bd671 --- /dev/null +++ b/swaggerci/cost-management/exports/Invoke-AzCostByDimensionExternalCloudProviderType.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the dimensions by the external cloud provider type. +.Description +Lists the dimensions by the external cloud provider type. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostbydimensionexternalcloudprovidertype +#> +function Invoke-AzCostByDimensionExternalCloudProviderType { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension])] +[CmdletBinding(DefaultParameterSetName='By', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='By', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + ${ExternalCloudProviderId}, + + [Parameter(ParameterSetName='By', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + # The external cloud provider type associated with dimension/query operations. + # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + ${ExternalCloudProviderType}, + + [Parameter(ParameterSetName='ByViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # May be used to expand the properties/data within a dimension category. + # By default, data is not included when listing dimensions. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + # Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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. + ${Skiptoken}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the most recent N dimension data. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + By = 'Az.Cost.private\Invoke-AzCostByDimensionExternalCloudProviderType_By'; + ByViaIdentity = 'Az.Cost.private\Invoke-AzCostByDimensionExternalCloudProviderType_ByViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.ps1 b/swaggerci/cost-management/exports/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.ps1 new file mode 100644 index 000000000000..2b9cd2004bd1 --- /dev/null +++ b/swaggerci/cost-management/exports/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.ps1 @@ -0,0 +1,208 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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 +.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 +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostbygeneratereservationdetailreportbillingaccountid +#> +function Invoke-AzCostByGenerateReservationDetailReportBillingAccountId { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus])] +[CmdletBinding(DefaultParameterSetName='By', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='By', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Enrollment ID (Legacy BillingAccount ID) + ${BillingAccountId}, + + [Parameter(ParameterSetName='ByViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # End Date + ${EndDate}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # Start Date + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + By = 'Az.Cost.private\Invoke-AzCostByGenerateReservationDetailReportBillingAccountId_By'; + ByViaIdentity = 'Az.Cost.private\Invoke-AzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.ps1 b/swaggerci/cost-management/exports/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.ps1 new file mode 100644 index 000000000000..60f1f00475c0 --- /dev/null +++ b/swaggerci/cost-management/exports/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.ps1 @@ -0,0 +1,214 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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 +.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 +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostbygeneratereservationdetailreportbillingprofileid +#> +function Invoke-AzCostByGenerateReservationDetailReportBillingProfileId { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus])] +[CmdletBinding(DefaultParameterSetName='By', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='By', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='By', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # BillingProfile ID + ${BillingProfileId}, + + [Parameter(ParameterSetName='ByViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # End Date + ${EndDate}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # Start Date + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + By = 'Az.Cost.private\Invoke-AzCostByGenerateReservationDetailReportBillingProfileId_By'; + ByViaIdentity = 'Az.Cost.private\Invoke-AzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Invoke-AzCostCloudForecast.ps1 b/swaggerci/cost-management/exports/Invoke-AzCostCloudForecast.ps1 new file mode 100644 index 000000000000..1a96de6f9af1 --- /dev/null +++ b/swaggerci/cost-management/exports/Invoke-AzCostCloudForecast.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the forecast charges for external cloud provider type defined. +.Description +Lists the forecast charges for external cloud provider type defined. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult +.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. + +FILTERAND : The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +FILTEROR : The logical "OR" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +PARAMETER : The definition of a forecast. + DatasetAggregation : 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. + [(Any) ]: This indicates any property can be added to this object. + Type : The type of the forecast. + [ConfigurationColumn ]: 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. + [DatasetGranularity ]: The granularity of rows in the forecast. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [IncludeActualCost ]: A boolean determining if actualCost will be included. + [IncludeFreshPartialCost ]: A boolean determining if FreshPartialCost will be included. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostcloudforecast +#> +function Invoke-AzCostCloudForecast { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult])] +[CmdletBinding(DefaultParameterSetName='CloudExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cloud', Mandatory)] + [Parameter(ParameterSetName='CloudExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + ${ExternalCloudProviderId}, + + [Parameter(ParameterSetName='Cloud', Mandatory)] + [Parameter(ParameterSetName='CloudExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + # The external cloud provider type associated with dimension/query operations. + # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + ${ExternalCloudProviderType}, + + [Parameter(ParameterSetName='CloudViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CloudViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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'. + ${Filter}, + + [Parameter(ParameterSetName='Cloud', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CloudViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition] + # The definition of a forecast. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CloudExpanded', Mandatory)] + [Parameter(ParameterSetName='CloudViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(Required, PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation]))] + [System.Collections.Hashtable] + # 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. + ${DatasetAggregation}, + + [Parameter(ParameterSetName='CloudExpanded', Mandatory)] + [Parameter(ParameterSetName='CloudViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType] + # The type of the forecast. + ${Type}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # 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. + ${ConfigurationColumn}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + # The granularity of rows in the forecast. + ${DatasetGranularity}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${DimensionName}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${DimensionValue}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]] + # The logical "AND" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTERAND properties and create a hash table. + ${FilterAnd}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]] + # The logical "OR" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTEROR properties and create a hash table. + ${FilterOr}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean determining if actualCost will be included. + ${IncludeActualCost}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean determining if FreshPartialCost will be included. + ${IncludeFreshPartialCost}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${TagName}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${TagValue}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date to pull data from. + ${TimePeriodFrom}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date to pull data to. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cloud = 'Az.Cost.private\Invoke-AzCostCloudForecast_Cloud'; + CloudExpanded = 'Az.Cost.private\Invoke-AzCostCloudForecast_CloudExpanded'; + CloudViaIdentity = 'Az.Cost.private\Invoke-AzCostCloudForecast_CloudViaIdentity'; + CloudViaIdentityExpanded = 'Az.Cost.private\Invoke-AzCostCloudForecast_CloudViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Invoke-AzCostDismissAlert.ps1 b/swaggerci/cost-management/exports/Invoke-AzCostDismissAlert.ps1 new file mode 100644 index 000000000000..c23b8b4f007b --- /dev/null +++ b/swaggerci/cost-management/exports/Invoke-AzCostDismissAlert.ps1 @@ -0,0 +1,489 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Dismisses the specified alert +.Description +Dismisses the specified alert +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +PARAMETER : The request payload to update an alert + [CloseTime ]: dateTime in which alert was closed + [CostEntityId ]: related budget + [CreationTime ]: dateTime in which alert was created + [DefinitionCategory ]: Alert category + [DefinitionCriterion ]: Criteria that triggered alert + [DefinitionType ]: type of alert + [Description ]: Alert description + [DetailAmount ]: budget threshold amount + [DetailCompanyName ]: company name + [DetailContactEmail ]: list of emails to contact + [DetailContactGroup ]: list of action groups to broadcast to + [DetailContactRole ]: list of contact roles + [DetailCurrentSpend ]: current spend + [DetailDepartmentName ]: department name + [DetailEnrollmentEndDate ]: datetime of enrollmentEndDate + [DetailEnrollmentNumber ]: enrollment number + [DetailEnrollmentStartDate ]: datetime of enrollmentStartDate + [DetailInvoicingThreshold ]: invoicing threshold + [DetailMeterFilter ]: array of meters to filter by + [DetailOperator ]: operator used to compare currentSpend with amount + [DetailOverridingAlert ]: overriding alert + [DetailPeriodStartDate ]: datetime of periodStartDate + [DetailResourceFilter ]: array of resources to filter by + [DetailResourceGroupFilter ]: array of resourceGroups to filter by + [DetailTagFilter ]: tags to filter by + [DetailThreshold ]: notification threshold percentage as a decimal which activated this alert + [DetailTimeGrainType ]: Type of timegrain cadence + [DetailTriggeredBy ]: notificationId that triggered this alert + [DetailUnit ]: unit of currency being used + [ModificationTime ]: dateTime in which alert was last modified + [Source ]: Source of alert + [Status ]: alert status + [StatusModificationTime ]: dateTime in which the alert status was last modified + [StatusModificationUserName ]: User who last modified the alert +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostdismissalert +#> +function Invoke-AzCostDismissAlert { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert])] +[CmdletBinding(DefaultParameterSetName='DismissExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Dismiss', Mandatory)] + [Parameter(ParameterSetName='DismissExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Alert ID + ${AlertId}, + + [Parameter(ParameterSetName='Dismiss', Mandatory)] + [Parameter(ParameterSetName='DismissExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='DismissViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DismissViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Dismiss', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DismissViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload] + # The request payload to update an alert + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # dateTime in which alert was closed + ${CloseTime}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # related budget + ${CostEntityId}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # dateTime in which alert was created + ${CreationTime}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory] + # Alert category + ${DefinitionCategory}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria] + # Criteria that triggered alert + ${DefinitionCriterion}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType] + # type of alert + ${DefinitionType}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # Alert description + ${Description}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Decimal] + # budget threshold amount + ${DetailAmount}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # company name + ${DetailCompanyName}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # list of emails to contact + ${DetailContactEmail}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # list of action groups to broadcast to + ${DetailContactGroup}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # list of contact roles + ${DetailContactRole}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Decimal] + # current spend + ${DetailCurrentSpend}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # department name + ${DetailDepartmentName}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # datetime of enrollmentEndDate + ${DetailEnrollmentEndDate}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # enrollment number + ${DetailEnrollmentNumber}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # datetime of enrollmentStartDate + ${DetailEnrollmentStartDate}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Decimal] + # invoicing threshold + ${DetailInvoicingThreshold}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]] + # array of meters to filter by + ${DetailMeterFilter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator] + # operator used to compare currentSpend with amount + ${DetailOperator}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # overriding alert + ${DetailOverridingAlert}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # datetime of periodStartDate + ${DetailPeriodStartDate}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]] + # array of resources to filter by + ${DetailResourceFilter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]] + # array of resourceGroups to filter by + ${DetailResourceGroupFilter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny] + # tags to filter by + ${DetailTagFilter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Decimal] + # notification threshold percentage as a decimal which activated this alert + ${DetailThreshold}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType] + # Type of timegrain cadence + ${DetailTimeGrainType}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # notificationId that triggered this alert + ${DetailTriggeredBy}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # unit of currency being used + ${DetailUnit}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # dateTime in which alert was last modified + ${ModificationTime}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource] + # Source of alert + ${Source}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus] + # alert status + ${Status}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # dateTime in which the alert status was last modified + ${StatusModificationTime}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # User who last modified the alert + ${StatusModificationUserName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Dismiss = 'Az.Cost.private\Invoke-AzCostDismissAlert_Dismiss'; + DismissExpanded = 'Az.Cost.private\Invoke-AzCostDismissAlert_DismissExpanded'; + DismissViaIdentity = 'Az.Cost.private\Invoke-AzCostDismissAlert_DismissViaIdentity'; + DismissViaIdentityExpanded = 'Az.Cost.private\Invoke-AzCostDismissAlert_DismissViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Invoke-AzCostExecuteExport.ps1 b/swaggerci/cost-management/exports/Invoke-AzCostExecuteExport.ps1 new file mode 100644 index 000000000000..0f2ba4954c41 --- /dev/null +++ b/swaggerci/cost-management/exports/Invoke-AzCostExecuteExport.ps1 @@ -0,0 +1,193 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The operation to execute an export. +.Description +The operation to execute an export. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +System.Boolean +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostexecuteexport +#> +function Invoke-AzCostExecuteExport { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Execute', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Execute', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${ExportName}, + + [Parameter(ParameterSetName='Execute', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='ExecuteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Execute = 'Az.Cost.private\Invoke-AzCostExecuteExport_Execute'; + ExecuteViaIdentity = 'Az.Cost.private\Invoke-AzCostExecuteExport_ExecuteViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Invoke-AzCostUsageForecast.ps1 b/swaggerci/cost-management/exports/Invoke-AzCostUsageForecast.ps1 new file mode 100644 index 000000000000..147e101cbfd2 --- /dev/null +++ b/swaggerci/cost-management/exports/Invoke-AzCostUsageForecast.ps1 @@ -0,0 +1,362 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the forecast charges for scope defined. +.Description +Lists the forecast charges for scope defined. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult +.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. + +FILTERAND : The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +FILTEROR : The logical "OR" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +PARAMETER : The definition of a forecast. + DatasetAggregation : 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. + [(Any) ]: This indicates any property can be added to this object. + Type : The type of the forecast. + [ConfigurationColumn ]: 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. + [DatasetGranularity ]: The granularity of rows in the forecast. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [IncludeActualCost ]: A boolean determining if actualCost will be included. + [IncludeFreshPartialCost ]: A boolean determining if FreshPartialCost will be included. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostusageforecast +#> +function Invoke-AzCostUsageForecast { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult])] +[CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Usage', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='UsageViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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'. + ${Filter}, + + [Parameter(ParameterSetName='Usage', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition] + # The definition of a forecast. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(Required, PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation]))] + [System.Collections.Hashtable] + # 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. + ${DatasetAggregation}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType] + # The type of the forecast. + ${Type}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # 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. + ${ConfigurationColumn}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + # The granularity of rows in the forecast. + ${DatasetGranularity}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${DimensionName}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${DimensionValue}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]] + # The logical "AND" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTERAND properties and create a hash table. + ${FilterAnd}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]] + # The logical "OR" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTEROR properties and create a hash table. + ${FilterOr}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean determining if actualCost will be included. + ${IncludeActualCost}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean determining if FreshPartialCost will be included. + ${IncludeFreshPartialCost}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${TagName}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${TagValue}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date to pull data from. + ${TimePeriodFrom}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date to pull data to. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Usage = 'Az.Cost.private\Invoke-AzCostUsageForecast_Usage'; + UsageExpanded = 'Az.Cost.private\Invoke-AzCostUsageForecast_UsageExpanded'; + UsageViaIdentity = 'Az.Cost.private\Invoke-AzCostUsageForecast_UsageViaIdentity'; + UsageViaIdentityExpanded = 'Az.Cost.private\Invoke-AzCostUsageForecast_UsageViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Invoke-AzCostUsageQuery.ps1 b/swaggerci/cost-management/exports/Invoke-AzCostUsageQuery.ps1 new file mode 100644 index 000000000000..d0fafd16c3f4 --- /dev/null +++ b/swaggerci/cost-management/exports/Invoke-AzCostUsageQuery.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Query the usage data for scope defined. +.Description +Query the usage data for scope defined. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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. + +DATASETGROUPING : Array of group by expression to use in the query. Query can have up to 2 group by clauses. + Name : The name of the column to group. + Type : Has type of the column to group. + +FILTERAND : The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +FILTEROR : The logical "OR" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +PARAMETER : The definition of a query. + Timeframe : The time frame for pulling data for the query. If custom, then a specific time period must be provided. + Type : The type of the query. + [ConfigurationColumn ]: 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. + [DatasetAggregation ]: 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. + [(Any) ]: This indicates any property can be added to this object. + [DatasetGranularity ]: The granularity of rows in the query. + [DatasetGrouping ]: Array of group by expression to use in the query. Query can have up to 2 group by clauses. + Name : The name of the column to group. + Type : Has type of the column to group. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostusagequery +#> +function Invoke-AzCostUsageQuery { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult])] +[CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Usage', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='Usage1', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + ${ExternalCloudProviderId}, + + [Parameter(ParameterSetName='Usage1', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + # The external cloud provider type associated with dimension/query operations. + # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + ${ExternalCloudProviderType}, + + [Parameter(ParameterSetName='UsageViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentity1', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Usage', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='Usage1', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition] + # The definition of a query. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType] + # The time frame for pulling data for the query. + # If custom, then a specific time period must be provided. + ${Timeframe}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType] + # The type of the query. + ${Type}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # 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. + ${ConfigurationColumn}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation]))] + [System.Collections.Hashtable] + # 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. + ${DatasetAggregation}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + # The granularity of rows in the query. + ${DatasetGranularity}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[]] + # Array of group by expression to use in the query. + # Query can have up to 2 group by clauses. + # To construct, see NOTES section for DATASETGROUPING properties and create a hash table. + ${DatasetGrouping}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${DimensionName}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${DimensionValue}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]] + # The logical "AND" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTERAND properties and create a hash table. + ${FilterAnd}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]] + # The logical "OR" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTEROR properties and create a hash table. + ${FilterOr}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${TagName}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${TagValue}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date to pull data from. + ${TimePeriodFrom}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date to pull data to. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(ParameterSetName='Usage')] + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentity')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Usage = 'Az.Cost.private\Invoke-AzCostUsageQuery_Usage'; + Usage1 = 'Az.Cost.private\Invoke-AzCostUsageQuery_Usage1'; + UsageExpanded = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageExpanded'; + UsageExpanded1 = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageExpanded1'; + UsageViaIdentity = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageViaIdentity'; + UsageViaIdentity1 = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageViaIdentity1'; + UsageViaIdentityExpanded = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageViaIdentityExpanded'; + UsageViaIdentityExpanded1 = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageViaIdentityExpanded1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/New-AzCostExport.ps1 b/swaggerci/cost-management/exports/New-AzCostExport.ps1 new file mode 100644 index 000000000000..02263c8a4489 --- /dev/null +++ b/swaggerci/cost-management/exports/New-AzCostExport.ps1 @@ -0,0 +1,297 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostexport +#> +function New-AzCostExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ExportName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # 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). + ${ConfigurationColumn}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + # The granularity of rows in the export. + # Currently only 'Daily' is supported. + ${DataSetGranularity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType] + # 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.Cost.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType] + # 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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the directory where exports will be uploaded. + ${DestinationRootFolderPath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.FormatType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType] + # The format of the export being delivered. + # Currently only 'Csv' is supported. + ${Format}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date of recurrence. + ${RecurrencePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date of recurrence. + ${RecurrencePeriodTo}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType] + # The schedule recurrence. + ${ScheduleRecurrence}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType] + # The status of the export's schedule. + # If 'Inactive', the export's schedule is paused. + ${ScheduleStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date for export data. + ${TimePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date for export data. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Cost.private\New-AzCostExport_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/New-AzCostGenerateCostDetailReportOperation.ps1 b/swaggerci/cost-management/exports/New-AzCostGenerateCostDetailReportOperation.ps1 new file mode 100644 index 000000000000..72dc3b6f1ee9 --- /dev/null +++ b/swaggerci/cost-management/exports/New-AzCostGenerateCostDetailReportOperation.ps1 @@ -0,0 +1,223 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostgeneratecostdetailreportoperation +#> +function New-AzCostGenerateCostDetailReportOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # 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. + ${BillingPeriod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # 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. + ${InvoiceId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType] + # The type of the detailed report. + # By default ActualCost is provided + ${Metric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The end date to pull data to. + # example format 2020-03-15 + ${TimePeriodEnd}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The start date to pull data from. + # example format 2020-03-15 + ${TimePeriodStart}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Cost.private\New-AzCostGenerateCostDetailReportOperation_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/New-AzCostGenerateDetailedCostReportOperation.ps1 b/swaggerci/cost-management/exports/New-AzCostGenerateDetailedCostReportOperation.ps1 new file mode 100644 index 000000000000..4e2bd45134fc --- /dev/null +++ b/swaggerci/cost-management/exports/New-AzCostGenerateDetailedCostReportOperation.ps1 @@ -0,0 +1,218 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. +Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. +A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored. +.Description +Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. +Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. +A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostgeneratedetailedcostreportoperation +#> +function New-AzCostGenerateDetailedCostReportOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # Billing Period in YearMonth(e.g. + # 202008) format. + # Only for legacy enterprise customers can use this. + # Can only have one of either timePeriod or invoiceId or billingPeriod parameters. + # If none provided current month cost is provided. + ${BillingPeriod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # Customer Id for Modern (Invoice Id and billing profile is also required for this). + ${CustomerId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # Invoice Id for PayAsYouGo customers and Modern billing profile scope. + # Can only have one of either timePeriod or invoiceId or billingPeriod parameters. + # If none provided current month cost is provided. + ${InvoiceId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType] + # The type of the detailed report. + # By default ActualCost is provided + ${Metric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The end date to pull data to. + # example format 2020-03-15 + ${TimePeriodEnd}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The start date to pull data from. + # example format 2020-03-15 + ${TimePeriodStart}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Cost.private\New-AzCostGenerateDetailedCostReportOperation_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/New-AzCostView.ps1 b/swaggerci/cost-management/exports/New-AzCostView.ps1 new file mode 100644 index 000000000000..b09f967ae83e --- /dev/null +++ b/swaggerci/cost-management/exports/New-AzCostView.ps1 @@ -0,0 +1,383 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +KPI : List of KPIs to show in Cost Analysis UI. + [Enabled ]: show the KPI in the UI? + [Id ]: ID of resource related to metric (budget). + [Type ]: KPI type (Forecast, Budget). + +PARAMETER : States and configurations of Cost Analysis. + [ETag ]: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + [Accumulated ]: Show costs accumulated over time. + [Chart ]: Chart type of the main view in Cost Analysis. Required. + [DisplayName ]: User input name of the view. Required. + [Kpi ]: List of KPIs to show in Cost Analysis UI. + [Enabled ]: show the KPI in the UI? + [Id ]: ID of resource related to metric (budget). + [Type ]: KPI type (Forecast, Budget). + [Metric ]: Metric to use when displaying costs. + [Pivot ]: Configuration of 3 sub-views in the Cost Analysis UI. + [Name ]: Data field to show in view. + [Type ]: Data type to show in view. + [Query ]: Query body configuration. Required. + Timeframe : The time frame for pulling data for the report. If custom, then a specific time period must be provided. + [ConfigurationColumn ]: 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. + [DataSetAggregation ]: 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. + [(Any) ]: This indicates any property can be added to this object. + [DataSetGranularity ]: The granularity of rows in the report. + [DataSetGrouping ]: Array of group by expression to use in the report. Report can have up to 2 group by clauses. + Name : The name of the column to group. This version supports subscription lowest possible grain. + Type : Has type of the column to group. + [DataSetSorting ]: Array of order by expression to use in the report. + Name : The name of the column to sort. + [Direction ]: Direction of sort. + [DimensionName ]: The name of the column to use in comparison. + [DimensionOperator ]: The operator to use for comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionOperator ]: The operator to use for comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagOperator ]: The operator to use for comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [IncludeMonetaryCommitment ]: If true, report includes monetary commitment. + [TagName ]: The name of the column to use in comparison. + [TagOperator ]: The operator to use for comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. + [Scope ]: 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. + +PIVOT : Configuration of 3 sub-views in the Cost Analysis UI. + [Name ]: Data field to show in view. + [Type ]: Data type to show in view. + +QUERY : Query body configuration. Required. + Timeframe : The time frame for pulling data for the report. If custom, then a specific time period must be provided. + [ConfigurationColumn ]: 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. + [DataSetAggregation ]: 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. + [(Any) ]: This indicates any property can be added to this object. + [DataSetGranularity ]: The granularity of rows in the report. + [DataSetGrouping ]: Array of group by expression to use in the report. Report can have up to 2 group by clauses. + Name : The name of the column to group. This version supports subscription lowest possible grain. + Type : Has type of the column to group. + [DataSetSorting ]: Array of order by expression to use in the report. + Name : The name of the column to sort. + [Direction ]: Direction of sort. + [DimensionName ]: The name of the column to use in comparison. + [DimensionOperator ]: The operator to use for comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionOperator ]: The operator to use for comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagOperator ]: The operator to use for comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [IncludeMonetaryCommitment ]: If true, report includes monetary commitment. + [TagName ]: The name of the column to use in comparison. + [TagOperator ]: The operator to use for comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostview +#> +function New-AzCostView { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Create1', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded1', Mandatory)] + [Alias('ViewName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # View name + ${Name}, + + [Parameter(ParameterSetName='Create1', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='CreateViaIdentity1', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Create1', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CreateViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView] + # States and configurations of Cost Analysis. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType] + # Show costs accumulated over time. + ${Accumulated}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType] + # Chart type of the main view in Cost Analysis. + # Required. + ${Chart}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # User input name of the view. + # Required. + ${DisplayName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[]] + # List of KPIs to show in Cost Analysis UI. + # To construct, see NOTES section for KPI properties and create a hash table. + ${Kpi}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType] + # Metric to use when displaying costs. + ${Metric}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[]] + # Configuration of 3 sub-views in the Cost Analysis UI. + # To construct, see NOTES section for PIVOT properties and create a hash table. + ${Pivot}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition] + # Query body configuration. + # Required. + # To construct, see NOTES section for QUERY properties and create a hash table. + ${Query}, + + [Parameter(ParameterSetName='CreateExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # 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. + ${PropertiesScope}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Create1 = 'Az.Cost.private\New-AzCostView_Create1'; + CreateExpanded = 'Az.Cost.private\New-AzCostView_CreateExpanded'; + CreateExpanded1 = 'Az.Cost.private\New-AzCostView_CreateExpanded1'; + CreateViaIdentity1 = 'Az.Cost.private\New-AzCostView_CreateViaIdentity1'; + CreateViaIdentityExpanded1 = 'Az.Cost.private\New-AzCostView_CreateViaIdentityExpanded1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/cost-management/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..8bee1be172c0 --- /dev/null +++ b/swaggerci/cost-management/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,5533 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the Alerts for external cloud provider type defined. +.Description +Lists the Alerts for external cloud provider type defined. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostalertexternal +#> +function Get-AzCostAlertExternal { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + ${ExternalCloudProviderId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + # The external cloud provider type associated with dimension/query operations. + # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + ${ExternalCloudProviderType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Cost.private\Get-AzCostAlertExternal_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the alert for the scope by alert ID. +.Description +Gets the alert for the scope by alert ID. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostalert +#> +function Get-AzCostAlert { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert], [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AlertId')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Alert ID + ${Id}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostAlert_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostAlert_GetViaIdentity'; + List = 'Az.Cost.private\Get-AzCostAlert_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists the dimensions by the defined scope. +.Description +Lists the dimensions by the defined scope. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostdimension +#> +function Get-AzCostDimension { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # May be used to expand the properties/data within a dimension category. + # By default, data is not included when listing dimensions. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + # Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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. + ${Skiptoken}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the most recent N dimension data. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Cost.private\Get-AzCostDimension_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The operation to get the execution history of an export for the defined scope and export name. +.Description +The operation to get the execution history of an export for the defined scope and export name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostexportexecutionhistory +#> +function Get-AzCostExportExecutionHistory { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${ExportName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostExportExecutionHistory_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostExportExecutionHistory_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The operation to get the export for the defined scope by export name. +.Description +The operation to get the export for the defined scope by export name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostexport +#> +function Get-AzCostExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ExportName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostExport_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostExport_GetViaIdentity'; + List = 'Az.Cost.private\Get-AzCostExport_List'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the result of the specified operation. +This link is provided in the CostDetails creation request response Location header. +.Description +Get the result of the specified operation. +This link is provided in the CostDetails creation request response Location header. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostgeneratecostdetailreportoperationresult +#> +function Get-AzCostGenerateCostDetailReportOperationResult { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # The target operation Id. + ${OperationId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostGenerateCostDetailReportOperationResult_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostGenerateCostDetailReportOperationResult_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the result of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. +.Description +Get the result of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostgeneratedetailedcostreportoperationresult +#> +function Get-AzCostGenerateDetailedCostReportOperationResult { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # The target operation Id. + ${OperationId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostGenerateDetailedCostReportOperationResult_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostGenerateDetailedCostReportOperationResult_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the status of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. +.Description +Get the status of the specified operation. +This link is provided in the GenerateDetailedCostReport creation request response header. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostgeneratedetailedcostreportoperationstatus +#> +function Get-AzCostGenerateDetailedCostReportOperationStatus { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # The target operation Id. + ${OperationId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostGenerateDetailedCostReportOperationStatus_Get'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostGenerateDetailedCostReportOperationStatus_GetViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the view by view name. +.Description +Gets the view by view name. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostview +#> +function Get-AzCostView { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Alias('ViewName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # View name + ${Name}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Cost.private\Get-AzCostView_Get'; + Get1 = 'Az.Cost.private\Get-AzCostView_Get1'; + GetViaIdentity = 'Az.Cost.private\Get-AzCostView_GetViaIdentity'; + GetViaIdentity1 = 'Az.Cost.private\Get-AzCostView_GetViaIdentity1'; + List = 'Az.Cost.private\Get-AzCostView_List'; + List1 = 'Az.Cost.private\Get-AzCostView_List1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists the dimensions by the external cloud provider type. +.Description +Lists the dimensions by the external cloud provider type. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostbydimensionexternalcloudprovidertype +#> +function Invoke-AzCostByDimensionExternalCloudProviderType { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension])] +[CmdletBinding(DefaultParameterSetName='By', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='By', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + ${ExternalCloudProviderId}, + + [Parameter(ParameterSetName='By', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + # The external cloud provider type associated with dimension/query operations. + # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + ${ExternalCloudProviderType}, + + [Parameter(ParameterSetName='ByViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # May be used to expand the properties/data within a dimension category. + # By default, data is not included when listing dimensions. + ${Expand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. + # Supported operators are 'eq','lt', 'gt', 'le', 'ge'. + ${Filter}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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. + ${Skiptoken}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.Int32] + # May be used to limit the number of results to the most recent N dimension data. + ${Top}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + By = 'Az.Cost.private\Invoke-AzCostByDimensionExternalCloudProviderType_By'; + ByViaIdentity = 'Az.Cost.private\Invoke-AzCostByDimensionExternalCloudProviderType_ByViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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 +.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 +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostbygeneratereservationdetailreportbillingaccountid +#> +function Invoke-AzCostByGenerateReservationDetailReportBillingAccountId { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus])] +[CmdletBinding(DefaultParameterSetName='By', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='By', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Enrollment ID (Legacy BillingAccount ID) + ${BillingAccountId}, + + [Parameter(ParameterSetName='ByViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # End Date + ${EndDate}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # Start Date + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + By = 'Az.Cost.private\Invoke-AzCostByGenerateReservationDetailReportBillingAccountId_By'; + ByViaIdentity = 'Az.Cost.private\Invoke-AzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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 +.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 +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostbygeneratereservationdetailreportbillingprofileid +#> +function Invoke-AzCostByGenerateReservationDetailReportBillingProfileId { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus])] +[CmdletBinding(DefaultParameterSetName='By', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='By', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # BillingAccount ID + ${BillingAccountId}, + + [Parameter(ParameterSetName='By', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # BillingProfile ID + ${BillingProfileId}, + + [Parameter(ParameterSetName='ByViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # End Date + ${EndDate}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # Start Date + ${StartDate}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + By = 'Az.Cost.private\Invoke-AzCostByGenerateReservationDetailReportBillingProfileId_By'; + ByViaIdentity = 'Az.Cost.private\Invoke-AzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists the forecast charges for external cloud provider type defined. +.Description +Lists the forecast charges for external cloud provider type defined. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult +.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. + +FILTERAND : The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +FILTEROR : The logical "OR" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +PARAMETER : The definition of a forecast. + DatasetAggregation : 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. + [(Any) ]: This indicates any property can be added to this object. + Type : The type of the forecast. + [ConfigurationColumn ]: 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. + [DatasetGranularity ]: The granularity of rows in the forecast. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [IncludeActualCost ]: A boolean determining if actualCost will be included. + [IncludeFreshPartialCost ]: A boolean determining if FreshPartialCost will be included. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostcloudforecast +#> +function Invoke-AzCostCloudForecast { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult])] +[CmdletBinding(DefaultParameterSetName='CloudExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Cloud', Mandatory)] + [Parameter(ParameterSetName='CloudExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + ${ExternalCloudProviderId}, + + [Parameter(ParameterSetName='Cloud', Mandatory)] + [Parameter(ParameterSetName='CloudExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + # The external cloud provider type associated with dimension/query operations. + # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + ${ExternalCloudProviderType}, + + [Parameter(ParameterSetName='CloudViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CloudViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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'. + ${Filter}, + + [Parameter(ParameterSetName='Cloud', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CloudViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition] + # The definition of a forecast. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CloudExpanded', Mandatory)] + [Parameter(ParameterSetName='CloudViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(Required, PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation]))] + [System.Collections.Hashtable] + # 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. + ${DatasetAggregation}, + + [Parameter(ParameterSetName='CloudExpanded', Mandatory)] + [Parameter(ParameterSetName='CloudViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType] + # The type of the forecast. + ${Type}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # 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. + ${ConfigurationColumn}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + # The granularity of rows in the forecast. + ${DatasetGranularity}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${DimensionName}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${DimensionValue}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]] + # The logical "AND" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTERAND properties and create a hash table. + ${FilterAnd}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]] + # The logical "OR" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTEROR properties and create a hash table. + ${FilterOr}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean determining if actualCost will be included. + ${IncludeActualCost}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean determining if FreshPartialCost will be included. + ${IncludeFreshPartialCost}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${TagName}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${TagValue}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date to pull data from. + ${TimePeriodFrom}, + + [Parameter(ParameterSetName='CloudExpanded')] + [Parameter(ParameterSetName='CloudViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date to pull data to. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Cloud = 'Az.Cost.private\Invoke-AzCostCloudForecast_Cloud'; + CloudExpanded = 'Az.Cost.private\Invoke-AzCostCloudForecast_CloudExpanded'; + CloudViaIdentity = 'Az.Cost.private\Invoke-AzCostCloudForecast_CloudViaIdentity'; + CloudViaIdentityExpanded = 'Az.Cost.private\Invoke-AzCostCloudForecast_CloudViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Dismisses the specified alert +.Description +Dismisses the specified alert +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +PARAMETER : The request payload to update an alert + [CloseTime ]: dateTime in which alert was closed + [CostEntityId ]: related budget + [CreationTime ]: dateTime in which alert was created + [DefinitionCategory ]: Alert category + [DefinitionCriterion ]: Criteria that triggered alert + [DefinitionType ]: type of alert + [Description ]: Alert description + [DetailAmount ]: budget threshold amount + [DetailCompanyName ]: company name + [DetailContactEmail ]: list of emails to contact + [DetailContactGroup ]: list of action groups to broadcast to + [DetailContactRole ]: list of contact roles + [DetailCurrentSpend ]: current spend + [DetailDepartmentName ]: department name + [DetailEnrollmentEndDate ]: datetime of enrollmentEndDate + [DetailEnrollmentNumber ]: enrollment number + [DetailEnrollmentStartDate ]: datetime of enrollmentStartDate + [DetailInvoicingThreshold ]: invoicing threshold + [DetailMeterFilter ]: array of meters to filter by + [DetailOperator ]: operator used to compare currentSpend with amount + [DetailOverridingAlert ]: overriding alert + [DetailPeriodStartDate ]: datetime of periodStartDate + [DetailResourceFilter ]: array of resources to filter by + [DetailResourceGroupFilter ]: array of resourceGroups to filter by + [DetailTagFilter ]: tags to filter by + [DetailThreshold ]: notification threshold percentage as a decimal which activated this alert + [DetailTimeGrainType ]: Type of timegrain cadence + [DetailTriggeredBy ]: notificationId that triggered this alert + [DetailUnit ]: unit of currency being used + [ModificationTime ]: dateTime in which alert was last modified + [Source ]: Source of alert + [Status ]: alert status + [StatusModificationTime ]: dateTime in which the alert status was last modified + [StatusModificationUserName ]: User who last modified the alert +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostdismissalert +#> +function Invoke-AzCostDismissAlert { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert])] +[CmdletBinding(DefaultParameterSetName='DismissExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Dismiss', Mandatory)] + [Parameter(ParameterSetName='DismissExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Alert ID + ${AlertId}, + + [Parameter(ParameterSetName='Dismiss', Mandatory)] + [Parameter(ParameterSetName='DismissExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='DismissViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DismissViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Dismiss', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DismissViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload] + # The request payload to update an alert + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # dateTime in which alert was closed + ${CloseTime}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # related budget + ${CostEntityId}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # dateTime in which alert was created + ${CreationTime}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory] + # Alert category + ${DefinitionCategory}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria] + # Criteria that triggered alert + ${DefinitionCriterion}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType] + # type of alert + ${DefinitionType}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # Alert description + ${Description}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Decimal] + # budget threshold amount + ${DetailAmount}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # company name + ${DetailCompanyName}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # list of emails to contact + ${DetailContactEmail}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # list of action groups to broadcast to + ${DetailContactGroup}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # list of contact roles + ${DetailContactRole}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Decimal] + # current spend + ${DetailCurrentSpend}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # department name + ${DetailDepartmentName}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # datetime of enrollmentEndDate + ${DetailEnrollmentEndDate}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # enrollment number + ${DetailEnrollmentNumber}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # datetime of enrollmentStartDate + ${DetailEnrollmentStartDate}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Decimal] + # invoicing threshold + ${DetailInvoicingThreshold}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]] + # array of meters to filter by + ${DetailMeterFilter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator] + # operator used to compare currentSpend with amount + ${DetailOperator}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # overriding alert + ${DetailOverridingAlert}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # datetime of periodStartDate + ${DetailPeriodStartDate}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]] + # array of resources to filter by + ${DetailResourceFilter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]] + # array of resourceGroups to filter by + ${DetailResourceGroupFilter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny] + # tags to filter by + ${DetailTagFilter}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Decimal] + # notification threshold percentage as a decimal which activated this alert + ${DetailThreshold}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType] + # Type of timegrain cadence + ${DetailTimeGrainType}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # notificationId that triggered this alert + ${DetailTriggeredBy}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # unit of currency being used + ${DetailUnit}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # dateTime in which alert was last modified + ${ModificationTime}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource] + # Source of alert + ${Source}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus] + # alert status + ${Status}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # dateTime in which the alert status was last modified + ${StatusModificationTime}, + + [Parameter(ParameterSetName='DismissExpanded')] + [Parameter(ParameterSetName='DismissViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # User who last modified the alert + ${StatusModificationUserName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Dismiss = 'Az.Cost.private\Invoke-AzCostDismissAlert_Dismiss'; + DismissExpanded = 'Az.Cost.private\Invoke-AzCostDismissAlert_DismissExpanded'; + DismissViaIdentity = 'Az.Cost.private\Invoke-AzCostDismissAlert_DismissViaIdentity'; + DismissViaIdentityExpanded = 'Az.Cost.private\Invoke-AzCostDismissAlert_DismissViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The operation to execute an export. +.Description +The operation to execute an export. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +System.Boolean +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostexecuteexport +#> +function Invoke-AzCostExecuteExport { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Execute', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Execute', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${ExportName}, + + [Parameter(ParameterSetName='Execute', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='ExecuteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Execute = 'Az.Cost.private\Invoke-AzCostExecuteExport_Execute'; + ExecuteViaIdentity = 'Az.Cost.private\Invoke-AzCostExecuteExport_ExecuteViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists the forecast charges for scope defined. +.Description +Lists the forecast charges for scope defined. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult +.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. + +FILTERAND : The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +FILTEROR : The logical "OR" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +PARAMETER : The definition of a forecast. + DatasetAggregation : 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. + [(Any) ]: This indicates any property can be added to this object. + Type : The type of the forecast. + [ConfigurationColumn ]: 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. + [DatasetGranularity ]: The granularity of rows in the forecast. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [IncludeActualCost ]: A boolean determining if actualCost will be included. + [IncludeFreshPartialCost ]: A boolean determining if FreshPartialCost will be included. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostusageforecast +#> +function Invoke-AzCostUsageForecast { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult])] +[CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Usage', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='UsageViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Query')] + [System.String] + # 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'. + ${Filter}, + + [Parameter(ParameterSetName='Usage', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition] + # The definition of a forecast. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(Required, PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation]))] + [System.Collections.Hashtable] + # 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. + ${DatasetAggregation}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType] + # The type of the forecast. + ${Type}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # 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. + ${ConfigurationColumn}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + # The granularity of rows in the forecast. + ${DatasetGranularity}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${DimensionName}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${DimensionValue}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]] + # The logical "AND" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTERAND properties and create a hash table. + ${FilterAnd}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]] + # The logical "OR" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTEROR properties and create a hash table. + ${FilterOr}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean determining if actualCost will be included. + ${IncludeActualCost}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean determining if FreshPartialCost will be included. + ${IncludeFreshPartialCost}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${TagName}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${TagValue}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date to pull data from. + ${TimePeriodFrom}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date to pull data to. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Usage = 'Az.Cost.private\Invoke-AzCostUsageForecast_Usage'; + UsageExpanded = 'Az.Cost.private\Invoke-AzCostUsageForecast_UsageExpanded'; + UsageViaIdentity = 'Az.Cost.private\Invoke-AzCostUsageForecast_UsageViaIdentity'; + UsageViaIdentityExpanded = 'Az.Cost.private\Invoke-AzCostUsageForecast_UsageViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Query the usage data for scope defined. +.Description +Query the usage data for scope defined. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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. + +DATASETGROUPING : Array of group by expression to use in the query. Query can have up to 2 group by clauses. + Name : The name of the column to group. + Type : Has type of the column to group. + +FILTERAND : The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +FILTEROR : The logical "OR" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +PARAMETER : The definition of a query. + Timeframe : The time frame for pulling data for the query. If custom, then a specific time period must be provided. + Type : The type of the query. + [ConfigurationColumn ]: 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. + [DatasetAggregation ]: 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. + [(Any) ]: This indicates any property can be added to this object. + [DatasetGranularity ]: The granularity of rows in the query. + [DatasetGrouping ]: Array of group by expression to use in the query. Query can have up to 2 group by clauses. + Name : The name of the column to group. + Type : Has type of the column to group. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostusagequery +#> +function Invoke-AzCostUsageQuery { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult])] +[CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Usage', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='Usage1', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + ${ExternalCloudProviderId}, + + [Parameter(ParameterSetName='Usage1', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + # The external cloud provider type associated with dimension/query operations. + # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + ${ExternalCloudProviderType}, + + [Parameter(ParameterSetName='UsageViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentity1', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Usage', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='Usage1', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UsageViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition] + # The definition of a query. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType] + # The time frame for pulling data for the query. + # If custom, then a specific time period must be provided. + ${Timeframe}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory)] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType] + # The type of the query. + ${Type}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # 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. + ${ConfigurationColumn}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation]))] + [System.Collections.Hashtable] + # 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. + ${DatasetAggregation}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + # The granularity of rows in the query. + ${DatasetGranularity}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[]] + # Array of group by expression to use in the query. + # Query can have up to 2 group by clauses. + # To construct, see NOTES section for DATASETGROUPING properties and create a hash table. + ${DatasetGrouping}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${DimensionName}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${DimensionValue}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]] + # The logical "AND" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTERAND properties and create a hash table. + ${FilterAnd}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]] + # The logical "OR" expression. + # Must have at least 2 items. + # To construct, see NOTES section for FILTEROR properties and create a hash table. + ${FilterOr}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the column to use in comparison. + ${TagName}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of values to use for comparison + ${TagValue}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date to pull data from. + ${TimePeriodFrom}, + + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageExpanded1')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date to pull data to. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(ParameterSetName='Usage')] + [Parameter(ParameterSetName='UsageExpanded')] + [Parameter(ParameterSetName='UsageViaIdentity')] + [Parameter(ParameterSetName='UsageViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Usage = 'Az.Cost.private\Invoke-AzCostUsageQuery_Usage'; + Usage1 = 'Az.Cost.private\Invoke-AzCostUsageQuery_Usage1'; + UsageExpanded = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageExpanded'; + UsageExpanded1 = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageExpanded1'; + UsageViaIdentity = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageViaIdentity'; + UsageViaIdentity1 = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageViaIdentity1'; + UsageViaIdentityExpanded = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageViaIdentityExpanded'; + UsageViaIdentityExpanded1 = 'Az.Cost.private\Invoke-AzCostUsageQuery_UsageViaIdentityExpanded1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostexport +#> +function New-AzCostExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ExportName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # 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). + ${ConfigurationColumn}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + # The granularity of rows in the export. + # Currently only 'Daily' is supported. + ${DataSetGranularity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType] + # 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.Cost.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType] + # 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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The name of the directory where exports will be uploaded. + ${DestinationRootFolderPath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.FormatType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType] + # The format of the export being delivered. + # Currently only 'Csv' is supported. + ${Format}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date of recurrence. + ${RecurrencePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date of recurrence. + ${RecurrencePeriodTo}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType] + # The schedule recurrence. + ${ScheduleRecurrence}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType] + # The status of the export's schedule. + # If 'Inactive', the export's schedule is paused. + ${ScheduleStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date for export data. + ${TimePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date for export data. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Cost.private\New-AzCostExport_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostgeneratecostdetailreportoperation +#> +function New-AzCostGenerateCostDetailReportOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # 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. + ${BillingPeriod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # 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. + ${InvoiceId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType] + # The type of the detailed report. + # By default ActualCost is provided + ${Metric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The end date to pull data to. + # example format 2020-03-15 + ${TimePeriodEnd}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The start date to pull data from. + # example format 2020-03-15 + ${TimePeriodStart}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Cost.private\New-AzCostGenerateCostDetailReportOperation_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. +Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. +A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored. +.Description +Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. +Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. +A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostgeneratedetailedcostreportoperation +#> +function New-AzCostGenerateDetailedCostReportOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # Billing Period in YearMonth(e.g. + # 202008) format. + # Only for legacy enterprise customers can use this. + # Can only have one of either timePeriod or invoiceId or billingPeriod parameters. + # If none provided current month cost is provided. + ${BillingPeriod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # Customer Id for Modern (Invoice Id and billing profile is also required for this). + ${CustomerId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # Invoice Id for PayAsYouGo customers and Modern billing profile scope. + # Can only have one of either timePeriod or invoiceId or billingPeriod parameters. + # If none provided current month cost is provided. + ${InvoiceId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType] + # The type of the detailed report. + # By default ActualCost is provided + ${Metric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The end date to pull data to. + # example format 2020-03-15 + ${TimePeriodEnd}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # The start date to pull data from. + # example format 2020-03-15 + ${TimePeriodStart}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Cost.private\New-AzCostGenerateDetailedCostReportOperation_CreateExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +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. +.Description +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. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name + +KPI : List of KPIs to show in Cost Analysis UI. + [Enabled ]: show the KPI in the UI? + [Id ]: ID of resource related to metric (budget). + [Type ]: KPI type (Forecast, Budget). + +PARAMETER : States and configurations of Cost Analysis. + [ETag ]: eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + [Accumulated ]: Show costs accumulated over time. + [Chart ]: Chart type of the main view in Cost Analysis. Required. + [DisplayName ]: User input name of the view. Required. + [Kpi ]: List of KPIs to show in Cost Analysis UI. + [Enabled ]: show the KPI in the UI? + [Id ]: ID of resource related to metric (budget). + [Type ]: KPI type (Forecast, Budget). + [Metric ]: Metric to use when displaying costs. + [Pivot ]: Configuration of 3 sub-views in the Cost Analysis UI. + [Name ]: Data field to show in view. + [Type ]: Data type to show in view. + [Query ]: Query body configuration. Required. + Timeframe : The time frame for pulling data for the report. If custom, then a specific time period must be provided. + [ConfigurationColumn ]: 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. + [DataSetAggregation ]: 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. + [(Any) ]: This indicates any property can be added to this object. + [DataSetGranularity ]: The granularity of rows in the report. + [DataSetGrouping ]: Array of group by expression to use in the report. Report can have up to 2 group by clauses. + Name : The name of the column to group. This version supports subscription lowest possible grain. + Type : Has type of the column to group. + [DataSetSorting ]: Array of order by expression to use in the report. + Name : The name of the column to sort. + [Direction ]: Direction of sort. + [DimensionName ]: The name of the column to use in comparison. + [DimensionOperator ]: The operator to use for comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionOperator ]: The operator to use for comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagOperator ]: The operator to use for comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [IncludeMonetaryCommitment ]: If true, report includes monetary commitment. + [TagName ]: The name of the column to use in comparison. + [TagOperator ]: The operator to use for comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. + [Scope ]: 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. + +PIVOT : Configuration of 3 sub-views in the Cost Analysis UI. + [Name ]: Data field to show in view. + [Type ]: Data type to show in view. + +QUERY : Query body configuration. Required. + Timeframe : The time frame for pulling data for the report. If custom, then a specific time period must be provided. + [ConfigurationColumn ]: 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. + [DataSetAggregation ]: 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. + [(Any) ]: This indicates any property can be added to this object. + [DataSetGranularity ]: The granularity of rows in the report. + [DataSetGrouping ]: Array of group by expression to use in the report. Report can have up to 2 group by clauses. + Name : The name of the column to group. This version supports subscription lowest possible grain. + Type : Has type of the column to group. + [DataSetSorting ]: Array of order by expression to use in the report. + Name : The name of the column to sort. + [Direction ]: Direction of sort. + [DimensionName ]: The name of the column to use in comparison. + [DimensionOperator ]: The operator to use for comparison. + [DimensionValue ]: Array of values to use for comparison + [FilterAnd ]: The logical "AND" expression. Must have at least 2 items. + [And ]: The logical "AND" expression. Must have at least 2 items. + [DimensionName ]: The name of the column to use in comparison. + [DimensionOperator ]: The operator to use for comparison. + [DimensionValue ]: Array of values to use for comparison + [Or ]: The logical "OR" expression. Must have at least 2 items. + [TagName ]: The name of the column to use in comparison. + [TagOperator ]: The operator to use for comparison. + [TagValue ]: Array of values to use for comparison + [FilterOr ]: The logical "OR" expression. Must have at least 2 items. + [IncludeMonetaryCommitment ]: If true, report includes monetary commitment. + [TagName ]: The name of the column to use in comparison. + [TagOperator ]: The operator to use for comparison. + [TagValue ]: Array of values to use for comparison + [TimePeriodFrom ]: The start date to pull data from. + [TimePeriodTo ]: The end date to pull data to. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostview +#> +function New-AzCostView { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Create1', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded1', Mandatory)] + [Alias('ViewName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # View name + ${Name}, + + [Parameter(ParameterSetName='Create1', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='CreateViaIdentity1', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Create1', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CreateViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView] + # States and configurations of Cost Analysis. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType] + # Show costs accumulated over time. + ${Accumulated}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType] + # Chart type of the main view in Cost Analysis. + # Required. + ${Chart}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # User input name of the view. + # Required. + ${DisplayName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[]] + # List of KPIs to show in Cost Analysis UI. + # To construct, see NOTES section for KPI properties and create a hash table. + ${Kpi}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType] + # Metric to use when displaying costs. + ${Metric}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[]] + # Configuration of 3 sub-views in the Cost Analysis UI. + # To construct, see NOTES section for PIVOT properties and create a hash table. + ${Pivot}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateExpanded1')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition] + # Query body configuration. + # Required. + # To construct, see NOTES section for QUERY properties and create a hash table. + ${Query}, + + [Parameter(ParameterSetName='CreateExpanded1')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String] + # 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. + ${PropertiesScope}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Create1 = 'Az.Cost.private\New-AzCostView_Create1'; + CreateExpanded = 'Az.Cost.private\New-AzCostView_CreateExpanded'; + CreateExpanded1 = 'Az.Cost.private\New-AzCostView_CreateExpanded1'; + CreateViaIdentity1 = 'Az.Cost.private\New-AzCostView_CreateViaIdentity1'; + CreateViaIdentityExpanded1 = 'Az.Cost.private\New-AzCostView_CreateViaIdentityExpanded1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The operation to delete a export. +.Description +The operation to delete a export. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +System.Boolean +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/remove-azcostexport +#> +function Remove-AzCostExport { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ExportName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Cost.private\Remove-AzCostExport_Delete'; + DeleteViaIdentity = 'Az.Cost.private\Remove-AzCostExport_DeleteViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The operation to delete a view. +.Description +The operation to delete a view. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +System.Boolean +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/remove-azcostview +#> +function Remove-AzCostView { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='Delete1', Mandatory)] + [Alias('ViewName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # View name + ${Name}, + + [Parameter(ParameterSetName='Delete1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Cost.private\Remove-AzCostView_Delete'; + Delete1 = 'Az.Cost.private\Remove-AzCostView_Delete1'; + DeleteViaIdentity = 'Az.Cost.private\Remove-AzCostView_DeleteViaIdentity'; + DeleteViaIdentity1 = 'Az.Cost.private\Remove-AzCostView_DeleteViaIdentity1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/README.md b/swaggerci/cost-management/exports/README.md new file mode 100644 index 000000000000..349e1bc36911 --- /dev/null +++ b/swaggerci/cost-management/exports/README.md @@ -0,0 +1,20 @@ +# Exports +This directory contains the cmdlets *exported by* `Az.Cost`. No other cmdlets in this repository are directly exported. What that means is the `Az.Cost` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`../bin/Az.Cost.private.dll`) and from the `../custom/Az.Cost.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](../internal/README.md) in the `../internal` folder. + +## Purpose +We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles. + +## Structure +The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile. + +## Usage +When `./Az.Cost.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message. \ No newline at end of file diff --git a/swaggerci/cost-management/exports/Remove-AzCostExport.ps1 b/swaggerci/cost-management/exports/Remove-AzCostExport.ps1 new file mode 100644 index 000000000000..cdd3521d5d93 --- /dev/null +++ b/swaggerci/cost-management/exports/Remove-AzCostExport.ps1 @@ -0,0 +1,194 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The operation to delete a export. +.Description +The operation to delete a export. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +System.Boolean +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/remove-azcostexport +#> +function Remove-AzCostExport { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ExportName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # Export Name. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Cost.private\Remove-AzCostExport_Delete'; + DeleteViaIdentity = 'Az.Cost.private\Remove-AzCostExport_DeleteViaIdentity'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/exports/Remove-AzCostView.ps1 b/swaggerci/cost-management/exports/Remove-AzCostView.ps1 new file mode 100644 index 000000000000..f006423f1c83 --- /dev/null +++ b/swaggerci/cost-management/exports/Remove-AzCostView.ps1 @@ -0,0 +1,198 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The operation to delete a view. +.Description +The operation to delete a view. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +System.Boolean +.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. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [BillingAccountId ]: Enrollment ID (Legacy BillingAccount ID) + [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. + [Id ]: Resource identity path + [OperationId ]: The target operation Id. + [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. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/remove-azcostview +#> +function Remove-AzCostView { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='Delete1', Mandatory)] + [Alias('ViewName')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # View name + ${Name}, + + [Parameter(ParameterSetName='Delete1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # 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. + ${Scope}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Cost.private\Remove-AzCostView_Delete'; + Delete1 = 'Az.Cost.private\Remove-AzCostView_Delete1'; + DeleteViaIdentity = 'Az.Cost.private\Remove-AzCostView_DeleteViaIdentity'; + DeleteViaIdentity1 = 'Az.Cost.private\Remove-AzCostView_DeleteViaIdentity1'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/cost-management/generate-help.ps1 b/swaggerci/cost-management/generate-help.ps1 new file mode 100644 index 000000000000..8a84a8ffb5c7 --- /dev/null +++ b/swaggerci/cost-management/generate-help.ps1 @@ -0,0 +1,66 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(-not (Test-Path $exportsFolder)) { + Write-Error "Exports folder '$exportsFolder' was not found." +} + +$directories = Get-ChildItem -Directory -Path $exportsFolder +$hasProfiles = ($directories | Measure-Object).Count -gt 0 +if(-not $hasProfiles) { + $directories = Get-Item -Path $exportsFolder +} + +$docsFolder = Join-Path $PSScriptRoot 'docs' +if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue +$examplesFolder = Join-Path $PSScriptRoot 'examples' + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.Cost.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.Cost.private.dll') +$instance = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName + +foreach($directory in $directories) +{ + if($hasProfiles) { + Select-AzProfile -Name $directory.Name + } + # Reload module per profile + Import-Module -Name $modulePath -Force + + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName + $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full } + $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo + + $docsPath = Join-Path $docsFolder $directory.Name + $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue + $examplesPath = Join-Path $examplesFolder $directory.Name + + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath + Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/cost-management/generated/Module.cs b/swaggerci/cost-management/generated/Module.cs new file mode 100644 index 000000000000..92b4c5a76181 --- /dev/null +++ b/swaggerci/cost-management/generated/Module.cs @@ -0,0 +1,181 @@ +// 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.Cost +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>; + using GetParameterDelegate = global::System.Func; + using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using ArgumentCompleterDelegate = global::System.Func; + using GetTelemetryIdDelegate = global::System.Func; + using TelemetryDelegate = global::System.Action; + using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; + using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; + using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + + /// A class that contains the module-common code and data. + public partial class Module + { + /// The currently selected profile. + public string Profile = global::System.String.Empty; + + public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + + /// the ISendAsync pipeline instance + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline _pipeline; + + /// the ISendAsync pipeline instance (when proxy is enabled) + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline _pipelineWithProxy; + + public bool _useProxy = false; + + public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); + + /// Gets completion data for azure specific fields + public ArgumentCompleterDelegate ArgumentCompleter { get; set; } + + /// The instance of the Client API + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient ClientAPI { get; set; } + + /// A delegate that gets called for each signalled event + public EventListenerDelegate EventListener { get; set; } + + /// The delegate to call to get parameter data from a common module. + public GetParameterDelegate GetParameterValue { get; set; } + + /// The delegate to get the telemetry Id. + public GetTelemetryIdDelegate GetTelemetryId { get; set; } + + /// Backing field for property. + private static Microsoft.Azure.PowerShell.Cmdlets.Cost.Module _instance; + + /// the singleton of this module class + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Module()); + + /// The Name of this module + public string Name => @"Az.Cost"; + + /// The delegate to call when this module is loaded (supporting a commmon module). + public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } + + /// The delegate to call before each new request (supporting a commmon module). + public NewRequestPipelineDelegate OnNewRequest { get; set; } + + /// The name of the currently selected Azure profile + public global::System.String ProfileName { get; set; } + + /// The ResourceID for this module (azure arm). + public string ResourceId => @"Az.Cost"; + + /// The delegate for creating a telemetry. + public TelemetryDelegate Telemetry { get; set; } + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline pipeline); + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline pipeline); + + partial void CustomInit(); + + /// Creates an instance of the HttpPipeline for each call. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the cmdlet's parameterset name. + /// a dict for extensible parameters + /// An instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline for the remote call. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline pipeline = null; + BeforeCreatePipeline(invocationInfo, ref pipeline); + pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone(); + AfterCreatePipeline(invocationInfo, ref pipeline); + pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync); + OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } ); + return pipeline; + } + + /// Gets parameters from a common module. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// The name of the parameter to get the value for. + /// + /// The parameter value from the common module. (Note: this should be type converted on the way back) + /// + public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName ); + + /// 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(); + } + + /// Creates the module instance. + private Module() + { + // constructor + ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient(); + _handler.Proxy = _webProxy; + _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient())); + _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler))); + } + + /// The HTTP Proxy to use. + /// The HTTP Proxy Credentials + /// True if the proxy should use default credentials + public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials) + { + _useProxy = proxy != null; + if (proxy == null) + { + return; + } + // set the proxy configuration + _webProxy.Address = proxy; + _webProxy.BypassProxyOnLocal = false; + if (proxyUseDefaultCredentials) + { + _webProxy.Credentials = null; + _webProxy.UseDefaultCredentials = true; + } + else + { + _webProxy.UseDefaultCredentials = false; + _webProxy.Credentials = proxyCredential ?.GetNetworkCredential(); + } + } + + /// Called to dispatch events to the common module listener + /// The ID of the event + /// The cancellation token for the event + /// A delegate to get the detailed event data + /// The callback for the event dispatcher + /// The from the cmdlet + /// the cmdlet's parameterset name. + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the exception that is being thrown (if available) + /// + /// A that will be complete when handling of the event is completed. + /// + public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception) + { + using( NoSynchronizationContext ) + { + await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/CostManagementClient.cs b/swaggerci/cost-management/generated/api/CostManagementClient.cs new file mode 100644 index 000000000000..7172f450e166 --- /dev/null +++ b/swaggerci/cost-management/generated/api/CostManagementClient.cs @@ -0,0 +1,6296 @@ +// 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.Cost +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Low-level API implementation for the CostManagementClient service. + /// + public partial class CostManagementClient + { + + /// 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. + /// 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.Cost.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 AlertsDismiss(string scope, string alertId, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsDismiss_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Dismisses the specified alert + /// + /// Parameters supplied to the Dismiss Alert 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.Cost.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 AlertsDismissViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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( + "/" + + scope + + "/providers/Microsoft.CostManagement/alerts/" + + alertId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + 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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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_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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Alert.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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. + /// + /// 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.Cost.Models.Api20211001.IDismissAlertPayload body, Microsoft.Azure.PowerShell.Cmdlets.Cost.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); + } + } + + /// 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 + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsGet_Call(request,onOk,onDefault,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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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( + "/" + + scope + + "/providers/Microsoft.CostManagement/alerts/" + + alertId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsGet_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Alert.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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. + /// + /// 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.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(alertId),alertId); + } + } + + /// 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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// 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.Cost.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 AlertsListExternal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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) + + "/alerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AlertsListExternal_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the Alerts for external cloud provider type 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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 '/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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + 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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// 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.Cost.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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. + /// 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.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + } + } + + /// 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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 DimensionsByExternalCloudProviderType(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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) + + "/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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DimensionsByExternalCloudProviderType_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// 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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/(?[^/]+)/(?[^/]+)/dimensions$", 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'"); + } + + // 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 + + "/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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + 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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DimensionsList_Call(request,onOk,onNoContent,onDefault,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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/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/dimensions'"); + } + + // 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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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 DimensionsList_Validate(string scope, string Filter, string Expand, string Skiptoken, int? Top, Microsoft.Azure.PowerShell.Cmdlets.Cost.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); + } + } + + /// + /// 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. + /// 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.Cost.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 ExportsCreateOrUpdate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsCreateOrUpdate_Call(request,onOk,onCreated,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. + /// + /// + /// 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.Cost.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 ExportsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // 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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExport body, Microsoft.Azure.PowerShell.Cmdlets.Cost.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); + } + } + + /// 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}' + /// 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.Cost.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 ExportsDelete(string scope, string exportName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsDelete_Call(request,onOk,onDefault,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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ExportsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ExportsDelete_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// 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.Cost.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 ExportsExecute(string scope, string exportName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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) + + "/run" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsExecute_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// The operation to execute an 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.Cost.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 ExportsExecuteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/(?[^/]+)/run$", 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'"); + } + + // 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 + + "/run" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsExecute_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ExportsExecute_Validate(string scope, string exportName, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsGetExecutionHistory_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The operation to get the execution history of an export for the defined scope and 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/(?[^/]+)/runHistory$", 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'"); + } + + // 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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// 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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsGet_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Export.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExportsList_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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" + + "?" + + (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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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 ForecastExternalCloudProviderUsageViaIdentity(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/(?[^/]+)/(?[^/]+)/forecast$", 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}/forecast'"); + } + + // 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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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. + /// 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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// + /// 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. + /// 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.Cost.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + 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); + } + } + + /// 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 + /// 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 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.Cost.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 ForecastUsage(string Filter, string scope, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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 ForecastUsageViaIdentity(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/forecast$", 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'"); + } + + // 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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ForecastUsage_Call(request,onOk,onNoContent,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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// + /// 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 + /// 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 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 Filter, string scope, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition body, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + 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); + } + } + + /// + /// 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.Cost.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 GenerateCostDetailsReportCreateOperation(string scope, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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 GenerateCostDetailsReportCreateOperationViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/generateCostDetailsReport$", 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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateCostDetailsReportCreateOperation_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.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.Cost.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsOperationResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition body, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateCostDetailsReportGetOperationResults_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.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.Cost.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsOperationResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(operationId),operationId); + } + } + + /// + /// Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously + /// at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation + /// created. A call on the operation will provide the status and if the operation is completed the blob file where generated + /// detailed cost report is being stored. + /// + /// 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 detailed cost report 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.Cost.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 GenerateDetailedCostReportCreateOperation(string scope, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/generateDetailedCostReport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateDetailedCostReportCreateOperation_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously + /// at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation + /// created. A call on the operation will provide the status and if the operation is completed the blob file where generated + /// detailed cost report is being stored. + /// + /// + /// Parameters supplied to the Create detailed cost report 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.Cost.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 GenerateDetailedCostReportCreateOperationViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/generateDetailedCostReport$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport'"); + } + + // 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/generateDetailedCostReport" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateDetailedCostReportCreateOperation_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 GenerateDetailedCostReportCreateOperation_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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.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.Cost.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportOperationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 detailed cost report 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 GenerateDetailedCostReportCreateOperation_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition body, Microsoft.Azure.PowerShell.Cmdlets.Cost.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 GenerateDetailedCostReport creation request response + /// header. + /// + /// The target operation Id. + /// 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. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// 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.Cost.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 GenerateDetailedCostReportOperationResultsGet(string operationId, string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/operationResults/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateDetailedCostReportOperationResultsGet_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// + /// Get the result of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response + /// header. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 202 (Accepted). + /// 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.Cost.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 GenerateDetailedCostReportOperationResultsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/operationResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}'"); + } + + // replace URI parameters with values from identity + var operationId = _match.Groups["operationId"].Value; + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/operationResults/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateDetailedCostReportOperationResultsGet_Call(request,onOk,onAccepted,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 202 (Accepted). + /// 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.Cost.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 GenerateDetailedCostReportOperationResultsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportOperationResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 target operation Id. + /// 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. + /// 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 GenerateDetailedCostReportOperationResultsGet_Validate(string operationId, string scope, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertNotNull(nameof(scope),scope); + } + } + + /// + /// Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response + /// header. + /// + /// The target operation Id. + /// 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. + /// 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.Cost.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 GenerateDetailedCostReportOperationStatusGet(string operationId, string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/operationStatus/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateDetailedCostReportOperationStatusGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response + /// 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.Cost.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 GenerateDetailedCostReportOperationStatusGetViaIdentity(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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/operationStatus/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}'"); + } + + // replace URI parameters with values from identity + var operationId = _match.Groups["operationId"].Value; + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.CostManagement/operationStatus/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateDetailedCostReportOperationStatusGet_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 GenerateDetailedCostReportOperationStatusGet_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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportOperationStatuses.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 target operation Id. + /// 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. + /// 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 GenerateDetailedCostReportOperationStatusGet_Validate(string operationId, string scope, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertNotNull(nameof(scope),scope); + } + } + + /// + /// 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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/generateReservationDetailsReport$", 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'"); + } + + // 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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateReservationDetailsReportByBillingAccountId_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.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.Cost.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/generateReservationDetailsReport$", 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'"); + } + + // 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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GenerateReservationDetailsReportByBillingProfileId_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.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.Cost.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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 QueryUsage(string scope, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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 QueryUsageByExternalCloudProviderType(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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 QueryUsageByExternalCloudProviderTypeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/(?[^/]+)/(?[^/]+)/query$", 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'"); + } + + // 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.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueryUsageByExternalCloudProviderType_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// 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 QueryUsageByExternalCloudProviderType_Validate(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType externalCloudProviderType, string externalCloudProviderId, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.Cost.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(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// 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.Cost.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 QueryUsageViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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/query$", 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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueryUsage_Call(request,onOk,onNoContent,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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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. + /// + /// 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.Cost.Models.Api20211001.IQueryDefinition body, Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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. + /// + /// 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.Cost.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 ViewsCreateOrUpdate(string viewName, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + 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 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.Cost.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 ViewsCreateOrUpdateByScope(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsCreateOrUpdateByScope_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. + /// + /// + /// 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.Cost.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 ViewsCreateOrUpdateByScopeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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 ViewsCreateOrUpdateByScope_Validate(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView body, Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// + /// + /// 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.Cost.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 ViewsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsCreateOrUpdate_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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// + /// 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 ViewsCreateOrUpdate_Validate(string viewName, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView body, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(viewName),viewName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// The operation to delete a view. + /// View name + /// 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.Cost.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 ViewsDelete(string viewName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// The operation to delete a view. + /// 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 + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsDeleteByScope_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// The operation to delete a view. + /// + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsDeleteByScope_Call(request,onOk,onNoContent,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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ViewsDeleteByScope_Validate(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(viewName),viewName); + } + } + + /// The operation to delete a view. + /// + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsDelete_Call(request,onOk,onNoContent,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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// + /// View 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 ViewsDelete_Validate(string viewName, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(viewName),viewName); + } + } + + /// Gets the view by view name. + /// View 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsGet_Call(request,onOk,onDefault,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 + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsGetByScope_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the view for the defined scope by view 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsGetByScope_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ViewsGetByScope_Validate(string scope, string viewName, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(viewName),viewName); + } + } + + /// Gets the view by view 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsGet_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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. + /// + /// View 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 ViewsGet_Validate(string viewName, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(viewName),viewName); + } + } + + /// Lists all views by tenant and object. + /// 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.Cost.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 ViewsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsList_Call(request,onOk,onDefault,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. + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsListByScope_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all views at the given scope. + /// + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsListByScope_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ViewsListByScope_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + } + } + + /// Lists all views by tenant and object. + /// + /// 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.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ViewsList_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). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Cost.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 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.Cost.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ViewsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Any.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Any.PowerShell.cs new file mode 100644 index 000000000000..405351a31a34 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Any.PowerShell.cs @@ -0,0 +1,136 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial class Any + { + + /// + /// 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 Any(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Any(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + 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.Cost.Models.IAny DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Any(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.Cost.Models.IAny DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Any(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.Cost.Models.IAny FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial interface IAny + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Any.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Any.TypeConverter.cs new file mode 100644 index 000000000000..f1bd816ef6d8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Any.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnyTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Any.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Any.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Any.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Any.cs b/swaggerci/cost-management/generated/api/Models/Any.cs new file mode 100644 index 000000000000..0b2e8317512f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Any.cs @@ -0,0 +1,34 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Any object + public partial class Any : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAnyInternal + { + + /// Creates an new instance. + public Any() + { + + } + } + /// Any object + public partial interface IAny : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + + } + /// Any object + internal partial interface IAnyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Any.json.cs b/swaggerci/cost-management/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..85b68c1d06d6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Any.json.cs @@ -0,0 +1,104 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Any object + public partial class Any + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal Any(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny. + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new Any(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.PowerShell.cs new file mode 100644 index 000000000000..b4b828247c80 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.PowerShell.cs @@ -0,0 +1,464 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource.CreateFrom); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType.CreateFrom); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory.CreateFrom); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria.CreateFrom); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType.CreateFrom); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailResourceGroupFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailResourceFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailMeterFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator.CreateFrom); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IAlertInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource.CreateFrom); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType.CreateFrom); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory.CreateFrom); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria.CreateFrom); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType.CreateFrom); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailResourceGroupFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailResourceFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailMeterFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator.CreateFrom); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IAlert FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.TypeConverter.cs new file mode 100644 index 000000000000..262a54828d32 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Alert.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Alert.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Alert.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.cs new file mode 100644 index 000000000000..5a51040fd98f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.cs @@ -0,0 +1,579 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// An individual alert. + public partial class Alert : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ProxyResource(); + + /// dateTime in which alert was closed + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string CloseTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CloseTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CloseTime = value ?? null; } + + /// related budget + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string CostEntityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CostEntityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CostEntityId = value ?? null; } + + /// dateTime in which alert was created + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CreationTime = value ?? null; } + + /// Alert category + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? DefinitionCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCategory = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory)""); } + + /// Criteria that triggered alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? DefinitionCriterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCriterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCriterion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria)""); } + + /// type of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType)""); } + + /// Alert description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Description = value ?? null; } + + /// budget threshold amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailAmount = value ?? default(decimal); } + + /// company name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCompanyName = value ?? null; } + + /// list of emails to contact + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DetailContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactEmail = value ?? null /* arrayOf */; } + + /// list of action groups to broadcast to + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DetailContactGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactGroup = value ?? null /* arrayOf */; } + + /// list of contact roles + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DetailContactRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactRole = value ?? null /* arrayOf */; } + + /// current spend + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailCurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCurrentSpend = value ?? default(decimal); } + + /// department name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailDepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailDepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailDepartmentName = value ?? null; } + + /// datetime of enrollmentEndDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailEnrollmentEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate = value ?? null; } + + /// enrollment number + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailEnrollmentNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentNumber = value ?? null; } + + /// datetime of enrollmentStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailEnrollmentStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate = value ?? null; } + + /// invoicing threshold + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailInvoicingThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailInvoicingThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailInvoicingThreshold = value ?? default(decimal); } + + /// array of meters to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailMeterFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailMeterFilter = value ?? null /* arrayOf */; } + + /// operator used to compare currentSpend with amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? DetailOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOperator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator)""); } + + /// overriding alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailOverridingAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOverridingAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOverridingAlert = value ?? null; } + + /// datetime of periodStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailPeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailPeriodStartDate = value ?? null; } + + /// array of resources to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceFilter = value ?? null /* arrayOf */; } + + /// array of resourceGroups to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceGroupFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceGroupFilter = value ?? null /* arrayOf */; } + + /// tags to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny DetailTagFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTagFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTagFilter = value ?? null /* model class */; } + + /// notification threshold percentage as a decimal which activated this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailThreshold = value ?? default(decimal); } + + /// Type of timegrain cadence + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType? DetailTimeGrainType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTimeGrainType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTimeGrainType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType)""); } + + /// notificationId that triggered this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailTriggeredBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTriggeredBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTriggeredBy = value ?? null; } + + /// unit of currency being used + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Definition = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Detail = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + + /// dateTime in which alert was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string ModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).ModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).ModificationTime = value ?? null; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties _property; + + /// Alert properties. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertProperties()); set => this._property = value; } + + /// Source of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Source = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource)""); } + + /// alert status + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus)""); } + + /// dateTime in which the alert status was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string StatusModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationTime = value ?? null; } + + /// User who last modified the alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string StatusModificationUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationUserName = value ?? null; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public Alert() + { + + } + + /// 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.Cost.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// An individual alert. + public partial interface IAlert : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource + { + /// dateTime in which alert was closed + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was closed", + SerializedName = @"closeTime", + PossibleTypes = new [] { typeof(string) })] + string CloseTime { get; set; } + /// related budget + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"related budget", + SerializedName = @"costEntityId", + PossibleTypes = new [] { typeof(string) })] + string CostEntityId { get; set; } + /// dateTime in which alert was created + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was created", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(string) })] + string CreationTime { get; set; } + /// Alert category + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert category", + SerializedName = @"category", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? DefinitionCategory { get; set; } + /// Criteria that triggered alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Criteria that triggered alert", + SerializedName = @"criteria", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? DefinitionCriterion { get; set; } + /// type of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"type of alert", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? DefinitionType { get; set; } + /// Alert description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// budget threshold amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"budget threshold amount", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailAmount { get; set; } + /// company name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"company name", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + string DetailCompanyName { get; set; } + /// list of emails to contact + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of emails to contact", + SerializedName = @"contactEmails", + PossibleTypes = new [] { typeof(string) })] + string[] DetailContactEmail { get; set; } + /// list of action groups to broadcast to + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of action groups to broadcast to", + SerializedName = @"contactGroups", + PossibleTypes = new [] { typeof(string) })] + string[] DetailContactGroup { get; set; } + /// list of contact roles + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of contact roles", + SerializedName = @"contactRoles", + PossibleTypes = new [] { typeof(string) })] + string[] DetailContactRole { get; set; } + /// current spend + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"current spend", + SerializedName = @"currentSpend", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailCurrentSpend { get; set; } + /// department name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"department name", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + string DetailDepartmentName { get; set; } + /// datetime of enrollmentEndDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentEndDate", + SerializedName = @"enrollmentEndDate", + PossibleTypes = new [] { typeof(string) })] + string DetailEnrollmentEndDate { get; set; } + /// enrollment number + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"enrollment number", + SerializedName = @"enrollmentNumber", + PossibleTypes = new [] { typeof(string) })] + string DetailEnrollmentNumber { get; set; } + /// datetime of enrollmentStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentStartDate", + SerializedName = @"enrollmentStartDate", + PossibleTypes = new [] { typeof(string) })] + string DetailEnrollmentStartDate { get; set; } + /// invoicing threshold + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"invoicing threshold", + SerializedName = @"invoicingThreshold", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailInvoicingThreshold { get; set; } + /// array of meters to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of meters to filter by", + SerializedName = @"meterFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get; set; } + /// operator used to compare currentSpend with amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operator used to compare currentSpend with amount", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? DetailOperator { get; set; } + /// overriding alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"overriding alert", + SerializedName = @"overridingAlert", + PossibleTypes = new [] { typeof(string) })] + string DetailOverridingAlert { get; set; } + /// datetime of periodStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of periodStartDate", + SerializedName = @"periodStartDate", + PossibleTypes = new [] { typeof(string) })] + string DetailPeriodStartDate { get; set; } + /// array of resources to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resources to filter by", + SerializedName = @"resourceFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get; set; } + /// array of resourceGroups to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resourceGroups to filter by", + SerializedName = @"resourceGroupFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get; set; } + /// tags to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"tags to filter by", + SerializedName = @"tagFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny DetailTagFilter { get; set; } + /// notification threshold percentage as a decimal which activated this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notification threshold percentage as a decimal which activated this alert", + SerializedName = @"threshold", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailThreshold { get; set; } + /// Type of timegrain cadence + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of timegrain cadence", + SerializedName = @"timeGrainType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + /// notificationId that triggered this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notificationId that triggered this alert", + SerializedName = @"triggeredBy", + PossibleTypes = new [] { typeof(string) })] + string DetailTriggeredBy { get; set; } + /// unit of currency being used + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"unit of currency being used", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string DetailUnit { get; set; } + /// dateTime in which alert was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was last modified", + SerializedName = @"modificationTime", + PossibleTypes = new [] { typeof(string) })] + string ModificationTime { get; set; } + /// Source of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source of alert", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? Source { get; set; } + /// alert status + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"alert status", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? Status { get; set; } + /// dateTime in which the alert status was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which the alert status was last modified", + SerializedName = @"statusModificationTime", + PossibleTypes = new [] { typeof(string) })] + string StatusModificationTime { get; set; } + /// User who last modified the alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User who last modified the alert", + SerializedName = @"statusModificationUserName", + PossibleTypes = new [] { typeof(string) })] + string StatusModificationUserName { get; set; } + + } + /// An individual alert. + internal partial interface IAlertInternal : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal + { + /// dateTime in which alert was closed + string CloseTime { get; set; } + /// related budget + string CostEntityId { get; set; } + /// dateTime in which alert was created + string CreationTime { get; set; } + /// defines the type of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition Definition { get; set; } + /// Alert category + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? DefinitionCategory { get; set; } + /// Criteria that triggered alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? DefinitionCriterion { get; set; } + /// type of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? DefinitionType { get; set; } + /// Alert description + string Description { get; set; } + /// Alert details + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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; } + /// list of action groups to broadcast to + string[] DetailContactGroup { get; set; } + /// list of contact roles + string[] DetailContactRole { get; set; } + /// current spend + decimal? DetailCurrentSpend { get; set; } + /// department name + string DetailDepartmentName { get; set; } + /// datetime of enrollmentEndDate + string DetailEnrollmentEndDate { get; set; } + /// enrollment number + string DetailEnrollmentNumber { get; set; } + /// datetime of enrollmentStartDate + string DetailEnrollmentStartDate { get; set; } + /// invoicing threshold + decimal? DetailInvoicingThreshold { get; set; } + /// array of meters to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get; set; } + /// operator used to compare currentSpend with amount + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? DetailOperator { get; set; } + /// overriding alert + string DetailOverridingAlert { get; set; } + /// datetime of periodStartDate + string DetailPeriodStartDate { get; set; } + /// array of resources to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get; set; } + /// array of resourceGroups to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get; set; } + /// tags to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + /// notificationId that triggered this alert + string DetailTriggeredBy { get; set; } + /// unit of currency being used + string DetailUnit { get; set; } + /// dateTime in which alert was last modified + string ModificationTime { get; set; } + /// Alert properties. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties Property { get; set; } + /// Source of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? Source { get; set; } + /// alert status + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? Status { get; set; } + /// dateTime in which the alert status was last modified + string StatusModificationTime { get; set; } + /// User who last modified the alert + string StatusModificationUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.json.cs new file mode 100644 index 000000000000..8c2b9330d43b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Alert.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// An individual alert. + public partial class Alert + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal Alert(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new Alert(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __proxyResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.PowerShell.cs new file mode 100644 index 000000000000..cab1f7db7aa9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.PowerShell.cs @@ -0,0 +1,424 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource.CreateFrom); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType.CreateFrom); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory.CreateFrom); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria.CreateFrom); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType.CreateFrom); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceGroupFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailMeterFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator.CreateFrom); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource.CreateFrom); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType.CreateFrom); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory.CreateFrom); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria.CreateFrom); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType.CreateFrom); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceGroupFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailMeterFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator.CreateFrom); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IAlertProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Alert properties. + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesTypeConverter))] + public partial interface IAlertProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.TypeConverter.cs new file mode 100644 index 000000000000..d4ae6a8f4048 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.cs new file mode 100644 index 000000000000..c43d65787431 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.cs @@ -0,0 +1,561 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Alert properties. + public partial class AlertProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal + { + + /// Backing field for property. + private string _closeTime; + + /// dateTime in which alert was closed + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string CloseTime { get => this._closeTime; set => this._closeTime = value; } + + /// Backing field for property. + private string _costEntityId; + + /// related budget + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string CostEntityId { get => this._costEntityId; set => this._costEntityId = value; } + + /// Backing field for property. + private string _creationTime; + + /// dateTime in which alert was created + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string CreationTime { get => this._creationTime; set => this._creationTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition _definition; + + /// defines the type of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinition()); set => this._definition = value; } + + /// Alert category + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? DefinitionCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Category = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory)""); } + + /// Criteria that triggered alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? DefinitionCriterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Criterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Criterion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria)""); } + + /// type of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)Definition).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType)""); } + + /// Backing field for property. + private string _description; + + /// Alert description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails _detail; + + /// Alert details + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetails()); set => this._detail = value; } + + /// budget threshold amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Amount = value ?? default(decimal); } + + /// company name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).CompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).CompanyName = value ?? null; } + + /// list of emails to contact + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DetailContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactEmail = value ?? null /* arrayOf */; } + + /// list of action groups to broadcast to + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DetailContactGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactGroup = value ?? null /* arrayOf */; } + + /// list of contact roles + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DetailContactRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ContactRole = value ?? null /* arrayOf */; } + + /// current spend + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailCurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).CurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).CurrentSpend = value ?? default(decimal); } + + /// department name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailDepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).DepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).DepartmentName = value ?? null; } + + /// datetime of enrollmentEndDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailEnrollmentEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentEndDate = value ?? null; } + + /// enrollment number + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailEnrollmentNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentNumber = value ?? null; } + + /// datetime of enrollmentStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailEnrollmentStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).EnrollmentStartDate = value ?? null; } + + /// invoicing threshold + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailInvoicingThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).InvoicingThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).InvoicingThreshold = value ?? default(decimal); } + + /// array of meters to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).MeterFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).MeterFilter = value ?? null /* arrayOf */; } + + /// operator used to compare currentSpend with amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? DetailOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Operator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator)""); } + + /// overriding alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailOverridingAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).OverridingAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).OverridingAlert = value ?? null; } + + /// datetime of periodStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).PeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).PeriodStartDate = value ?? null; } + + /// array of resources to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ResourceFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ResourceFilter = value ?? null /* arrayOf */; } + + /// array of resourceGroups to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ResourceGroupFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).ResourceGroupFilter = value ?? null /* arrayOf */; } + + /// tags to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny DetailTagFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TagFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TagFilter = value ?? null /* model class */; } + + /// notification threshold percentage as a decimal which activated this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Threshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Threshold = value ?? default(decimal); } + + /// Type of timegrain cadence + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType? DetailTimeGrainType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TimeGrainType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TimeGrainType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType)""); } + + /// notificationId that triggered this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailTriggeredBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TriggeredBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).TriggeredBy = value ?? null; } + + /// unit of currency being used + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Unit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)Detail).Unit = value ?? null; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinition()); set { {_definition = value;} } } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal.Detail { get => (this._detail = this._detail ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetails()); set { {_detail = value;} } } + + /// Backing field for property. + private string _modificationTime; + + /// dateTime in which alert was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string ModificationTime { get => this._modificationTime; set => this._modificationTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? _source; + + /// Source of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? Source { get => this._source; set => this._source = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? _status; + + /// alert status + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _statusModificationTime; + + /// dateTime in which the alert status was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string StatusModificationTime { get => this._statusModificationTime; set => this._statusModificationTime = value; } + + /// Backing field for property. + private string _statusModificationUserName; + + /// User who last modified the alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string StatusModificationUserName { get => this._statusModificationUserName; set => this._statusModificationUserName = value; } + + /// Creates an new instance. + public AlertProperties() + { + + } + } + /// Alert properties. + public partial interface IAlertProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// dateTime in which alert was closed + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was closed", + SerializedName = @"closeTime", + PossibleTypes = new [] { typeof(string) })] + string CloseTime { get; set; } + /// related budget + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"related budget", + SerializedName = @"costEntityId", + PossibleTypes = new [] { typeof(string) })] + string CostEntityId { get; set; } + /// dateTime in which alert was created + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was created", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(string) })] + string CreationTime { get; set; } + /// Alert category + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert category", + SerializedName = @"category", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? DefinitionCategory { get; set; } + /// Criteria that triggered alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Criteria that triggered alert", + SerializedName = @"criteria", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? DefinitionCriterion { get; set; } + /// type of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"type of alert", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? DefinitionType { get; set; } + /// Alert description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// budget threshold amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"budget threshold amount", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailAmount { get; set; } + /// company name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"company name", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + string DetailCompanyName { get; set; } + /// list of emails to contact + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of emails to contact", + SerializedName = @"contactEmails", + PossibleTypes = new [] { typeof(string) })] + string[] DetailContactEmail { get; set; } + /// list of action groups to broadcast to + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of action groups to broadcast to", + SerializedName = @"contactGroups", + PossibleTypes = new [] { typeof(string) })] + string[] DetailContactGroup { get; set; } + /// list of contact roles + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of contact roles", + SerializedName = @"contactRoles", + PossibleTypes = new [] { typeof(string) })] + string[] DetailContactRole { get; set; } + /// current spend + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"current spend", + SerializedName = @"currentSpend", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailCurrentSpend { get; set; } + /// department name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"department name", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + string DetailDepartmentName { get; set; } + /// datetime of enrollmentEndDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentEndDate", + SerializedName = @"enrollmentEndDate", + PossibleTypes = new [] { typeof(string) })] + string DetailEnrollmentEndDate { get; set; } + /// enrollment number + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"enrollment number", + SerializedName = @"enrollmentNumber", + PossibleTypes = new [] { typeof(string) })] + string DetailEnrollmentNumber { get; set; } + /// datetime of enrollmentStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentStartDate", + SerializedName = @"enrollmentStartDate", + PossibleTypes = new [] { typeof(string) })] + string DetailEnrollmentStartDate { get; set; } + /// invoicing threshold + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"invoicing threshold", + SerializedName = @"invoicingThreshold", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailInvoicingThreshold { get; set; } + /// array of meters to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of meters to filter by", + SerializedName = @"meterFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get; set; } + /// operator used to compare currentSpend with amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operator used to compare currentSpend with amount", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? DetailOperator { get; set; } + /// overriding alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"overriding alert", + SerializedName = @"overridingAlert", + PossibleTypes = new [] { typeof(string) })] + string DetailOverridingAlert { get; set; } + /// datetime of periodStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of periodStartDate", + SerializedName = @"periodStartDate", + PossibleTypes = new [] { typeof(string) })] + string DetailPeriodStartDate { get; set; } + /// array of resources to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resources to filter by", + SerializedName = @"resourceFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get; set; } + /// array of resourceGroups to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resourceGroups to filter by", + SerializedName = @"resourceGroupFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get; set; } + /// tags to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"tags to filter by", + SerializedName = @"tagFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny DetailTagFilter { get; set; } + /// notification threshold percentage as a decimal which activated this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notification threshold percentage as a decimal which activated this alert", + SerializedName = @"threshold", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailThreshold { get; set; } + /// Type of timegrain cadence + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of timegrain cadence", + SerializedName = @"timeGrainType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + /// notificationId that triggered this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notificationId that triggered this alert", + SerializedName = @"triggeredBy", + PossibleTypes = new [] { typeof(string) })] + string DetailTriggeredBy { get; set; } + /// unit of currency being used + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"unit of currency being used", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string DetailUnit { get; set; } + /// dateTime in which alert was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was last modified", + SerializedName = @"modificationTime", + PossibleTypes = new [] { typeof(string) })] + string ModificationTime { get; set; } + /// Source of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source of alert", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? Source { get; set; } + /// alert status + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"alert status", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? Status { get; set; } + /// dateTime in which the alert status was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which the alert status was last modified", + SerializedName = @"statusModificationTime", + PossibleTypes = new [] { typeof(string) })] + string StatusModificationTime { get; set; } + /// User who last modified the alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User who last modified the alert", + SerializedName = @"statusModificationUserName", + PossibleTypes = new [] { typeof(string) })] + string StatusModificationUserName { get; set; } + + } + /// Alert properties. + internal partial interface IAlertPropertiesInternal + + { + /// dateTime in which alert was closed + string CloseTime { get; set; } + /// related budget + string CostEntityId { get; set; } + /// dateTime in which alert was created + string CreationTime { get; set; } + /// defines the type of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition Definition { get; set; } + /// Alert category + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? DefinitionCategory { get; set; } + /// Criteria that triggered alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? DefinitionCriterion { get; set; } + /// type of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? DefinitionType { get; set; } + /// Alert description + string Description { get; set; } + /// Alert details + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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; } + /// list of action groups to broadcast to + string[] DetailContactGroup { get; set; } + /// list of contact roles + string[] DetailContactRole { get; set; } + /// current spend + decimal? DetailCurrentSpend { get; set; } + /// department name + string DetailDepartmentName { get; set; } + /// datetime of enrollmentEndDate + string DetailEnrollmentEndDate { get; set; } + /// enrollment number + string DetailEnrollmentNumber { get; set; } + /// datetime of enrollmentStartDate + string DetailEnrollmentStartDate { get; set; } + /// invoicing threshold + decimal? DetailInvoicingThreshold { get; set; } + /// array of meters to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get; set; } + /// operator used to compare currentSpend with amount + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? DetailOperator { get; set; } + /// overriding alert + string DetailOverridingAlert { get; set; } + /// datetime of periodStartDate + string DetailPeriodStartDate { get; set; } + /// array of resources to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get; set; } + /// array of resourceGroups to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get; set; } + /// tags to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + /// notificationId that triggered this alert + string DetailTriggeredBy { get; set; } + /// unit of currency being used + string DetailUnit { get; set; } + /// dateTime in which alert was last modified + string ModificationTime { get; set; } + /// Source of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? Source { get; set; } + /// alert status + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? Status { get; set; } + /// dateTime in which the alert status was last modified + string StatusModificationTime { get; set; } + /// User who last modified the alert + string StatusModificationUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.json.cs new file mode 100644 index 000000000000..b7169aba039a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertProperties.json.cs @@ -0,0 +1,128 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Alert properties. + public partial class AlertProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal AlertProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinition.FromJson(__jsonDefinition) : Definition;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new AlertProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._definition ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._definition.ToJson(null,serializationMode) : null, "definition" ,container.Add ); + AddIf( null != this._detail ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._detail.ToJson(null,serializationMode) : null, "details" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._source)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._source.ToString()) : null, "source" ,container.Add ); + AddIf( null != (((object)this._costEntityId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._costEntityId.ToString()) : null, "costEntityId" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._creationTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._creationTime.ToString()) : null, "creationTime" ,container.Add ); + AddIf( null != (((object)this._closeTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._closeTime.ToString()) : null, "closeTime" ,container.Add ); + AddIf( null != (((object)this._modificationTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._modificationTime.ToString()) : null, "modificationTime" ,container.Add ); + AddIf( null != (((object)this._statusModificationUserName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._statusModificationUserName.ToString()) : null, "statusModificationUserName" ,container.Add ); + AddIf( null != (((object)this._statusModificationTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._statusModificationTime.ToString()) : null, "statusModificationTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.PowerShell.cs new file mode 100644 index 000000000000..8e15d0b88fa8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.PowerShell.cs @@ -0,0 +1,160 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// defines the type of alert + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDefinitionTypeConverter))] + public partial class AlertPropertiesDefinition + { + + /// + /// 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 AlertPropertiesDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType.CreateFrom); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Category = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory?) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Category, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory.CreateFrom); + } + if (content.Contains("Criterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria?) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertPropertiesDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType.CreateFrom); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Category = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory?) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Category, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory.CreateFrom); + } + if (content.Contains("Criterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria?) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria.CreateFrom); + } + 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.Cost.Models.Api20211001.IAlertPropertiesDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertPropertiesDefinition(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.Cost.Models.Api20211001.IAlertPropertiesDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertPropertiesDefinition(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.Cost.Models.Api20211001.IAlertPropertiesDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// defines the type of alert + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDefinitionTypeConverter))] + public partial interface IAlertPropertiesDefinition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.TypeConverter.cs new file mode 100644 index 000000000000..5fbc6f24ac56 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertPropertiesDefinitionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertPropertiesDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertPropertiesDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertPropertiesDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.cs new file mode 100644 index 000000000000..fd8c75561886 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.cs @@ -0,0 +1,85 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// defines the type of alert + public partial class AlertPropertiesDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinitionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? _category; + + /// Alert category + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? Category { get => this._category; set => this._category = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? _criterion; + + /// Criteria that triggered alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? Criterion { get => this._criterion; set => this._criterion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? _type; + + /// type of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public AlertPropertiesDefinition() + { + + } + } + /// defines the type of alert + public partial interface IAlertPropertiesDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Alert category + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert category", + SerializedName = @"category", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? Category { get; set; } + /// Criteria that triggered alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Criteria that triggered alert", + SerializedName = @"criteria", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? Criterion { get; set; } + /// type of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"type of alert", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? Type { get; set; } + + } + /// defines the type of alert + internal partial interface IAlertPropertiesDefinitionInternal + + { + /// Alert category + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? Category { get; set; } + /// Criteria that triggered alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? Criterion { get; set; } + /// type of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.json.cs new file mode 100644 index 000000000000..85017c4b4a08 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDefinition.json.cs @@ -0,0 +1,112 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// defines the type of alert + public partial class AlertPropertiesDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal AlertPropertiesDefinition(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new AlertPropertiesDefinition(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._category.ToString()) : null, "category" ,container.Add ); + AddIf( null != (((object)this._criterion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._criterion.ToString()) : null, "criteria" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.PowerShell.cs new file mode 100644 index 000000000000..b8f0d04b8fd8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.PowerShell.cs @@ -0,0 +1,312 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType?) content.GetValueForProperty("TimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType.CreateFrom); + } + if (content.Contains("PeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).PeriodStartDate = (string) content.GetValueForProperty("PeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).PeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("TriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TriggeredBy = (string) content.GetValueForProperty("TriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("ResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("ResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("ResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("MeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).MeterFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("MeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).MeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("TagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TagFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) content.GetValueForProperty("TagFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TagFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Threshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Threshold = (decimal?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Threshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator?) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator.CreateFrom); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("CurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CurrentSpend = (decimal?) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactEmail = (string[]) content.GetValueForProperty("ContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactGroup = (string[]) content.GetValueForProperty("ContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactRole = (string[]) content.GetValueForProperty("ContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).OverridingAlert = (string) content.GetValueForProperty("OverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).OverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CompanyName = (string) content.GetValueForProperty("CompanyName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CompanyName, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentNumber = (string) content.GetValueForProperty("EnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate = (string) content.GetValueForProperty("EnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate = (string) content.GetValueForProperty("EnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("InvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).InvoicingThreshold = (decimal?) content.GetValueForProperty("InvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType?) content.GetValueForProperty("TimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType.CreateFrom); + } + if (content.Contains("PeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).PeriodStartDate = (string) content.GetValueForProperty("PeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).PeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("TriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TriggeredBy = (string) content.GetValueForProperty("TriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("ResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("ResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("ResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("MeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).MeterFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("MeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).MeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("TagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TagFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) content.GetValueForProperty("TagFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).TagFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("Threshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Threshold = (decimal?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Threshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator?) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator.CreateFrom); + } + if (content.Contains("Amount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Amount = (decimal?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Amount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("CurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CurrentSpend = (decimal?) content.GetValueForProperty("CurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("ContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactEmail = (string[]) content.GetValueForProperty("ContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactGroup = (string[]) content.GetValueForProperty("ContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactRole = (string[]) content.GetValueForProperty("ContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).ContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("OverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).OverridingAlert = (string) content.GetValueForProperty("OverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).OverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).DepartmentName = (string) content.GetValueForProperty("DepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).DepartmentName, global::System.Convert.ToString); + } + if (content.Contains("CompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CompanyName = (string) content.GetValueForProperty("CompanyName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).CompanyName, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentNumber = (string) content.GetValueForProperty("EnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate = (string) content.GetValueForProperty("EnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("EnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate = (string) content.GetValueForProperty("EnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).EnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("InvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal)this).InvoicingThreshold = (decimal?) content.GetValueForProperty("InvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IAlertPropertiesDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Alert details + [System.ComponentModel.TypeConverter(typeof(AlertPropertiesDetailsTypeConverter))] + public partial interface IAlertPropertiesDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.TypeConverter.cs new file mode 100644 index 000000000000..859039fe09de --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertPropertiesDetailsTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertPropertiesDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertPropertiesDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertPropertiesDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.cs new file mode 100644 index 000000000000..31021395d0dd --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.cs @@ -0,0 +1,408 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Alert details + public partial class AlertPropertiesDetails : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetailsInternal + { + + /// Backing field for property. + private decimal? _amount; + + /// budget threshold amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public decimal? Amount { get => this._amount; set => this._amount = value; } + + /// Backing field for property. + private string _companyName; + + /// company name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string CompanyName { get => this._companyName; set => this._companyName = value; } + + /// Backing field for property. + private string[] _contactEmail; + + /// list of emails to contact + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] ContactEmail { get => this._contactEmail; set => this._contactEmail = value; } + + /// Backing field for property. + private string[] _contactGroup; + + /// list of action groups to broadcast to + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] ContactGroup { get => this._contactGroup; set => this._contactGroup = value; } + + /// Backing field for property. + private string[] _contactRole; + + /// list of contact roles + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] ContactRole { get => this._contactRole; set => this._contactRole = value; } + + /// Backing field for property. + private decimal? _currentSpend; + + /// current spend + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public decimal? CurrentSpend { get => this._currentSpend; set => this._currentSpend = value; } + + /// Backing field for property. + private string _departmentName; + + /// department name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string DepartmentName { get => this._departmentName; set => this._departmentName = value; } + + /// Backing field for property. + private string _enrollmentEndDate; + + /// datetime of enrollmentEndDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string EnrollmentEndDate { get => this._enrollmentEndDate; set => this._enrollmentEndDate = value; } + + /// Backing field for property. + private string _enrollmentNumber; + + /// enrollment number + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string EnrollmentNumber { get => this._enrollmentNumber; set => this._enrollmentNumber = value; } + + /// Backing field for property. + private string _enrollmentStartDate; + + /// datetime of enrollmentStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string EnrollmentStartDate { get => this._enrollmentStartDate; set => this._enrollmentStartDate = value; } + + /// Backing field for property. + private decimal? _invoicingThreshold; + + /// invoicing threshold + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public decimal? InvoicingThreshold { get => this._invoicingThreshold; set => this._invoicingThreshold = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] _meterFilter; + + /// array of meters to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] MeterFilter { get => this._meterFilter; set => this._meterFilter = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? _operator; + + /// operator used to compare currentSpend with amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? Operator { get => this._operator; set => this._operator = value; } + + /// Backing field for property. + private string _overridingAlert; + + /// overriding alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string OverridingAlert { get => this._overridingAlert; set => this._overridingAlert = value; } + + /// Backing field for property. + private string _periodStartDate; + + /// datetime of periodStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string PeriodStartDate { get => this._periodStartDate; set => this._periodStartDate = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] _resourceFilter; + + /// array of resources to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] ResourceFilter { get => this._resourceFilter; set => this._resourceFilter = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] _resourceGroupFilter; + + /// array of resourceGroups to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] ResourceGroupFilter { get => this._resourceGroupFilter; set => this._resourceGroupFilter = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny _tagFilter; + + /// tags to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny TagFilter { get => (this._tagFilter = this._tagFilter ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Any()); set => this._tagFilter = value; } + + /// Backing field for property. + private decimal? _threshold; + + /// notification threshold percentage as a decimal which activated this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public decimal? Threshold { get => this._threshold; set => this._threshold = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType? _timeGrainType; + + /// Type of timegrain cadence + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType? TimeGrainType { get => this._timeGrainType; set => this._timeGrainType = value; } + + /// Backing field for property. + private string _triggeredBy; + + /// notificationId that triggered this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string TriggeredBy { get => this._triggeredBy; set => this._triggeredBy = value; } + + /// Backing field for property. + private string _unit; + + /// unit of currency being used + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Unit { get => this._unit; set => this._unit = value; } + + /// Creates an new instance. + public AlertPropertiesDetails() + { + + } + } + /// Alert details + public partial interface IAlertPropertiesDetails : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// budget threshold amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"budget threshold amount", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Amount { get; set; } + /// company name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"company name", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + string CompanyName { get; set; } + /// list of emails to contact + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of emails to contact", + SerializedName = @"contactEmails", + PossibleTypes = new [] { typeof(string) })] + string[] ContactEmail { get; set; } + /// list of action groups to broadcast to + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of action groups to broadcast to", + SerializedName = @"contactGroups", + PossibleTypes = new [] { typeof(string) })] + string[] ContactGroup { get; set; } + /// list of contact roles + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of contact roles", + SerializedName = @"contactRoles", + PossibleTypes = new [] { typeof(string) })] + string[] ContactRole { get; set; } + /// current spend + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"current spend", + SerializedName = @"currentSpend", + PossibleTypes = new [] { typeof(decimal) })] + decimal? CurrentSpend { get; set; } + /// department name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"department name", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + string DepartmentName { get; set; } + /// datetime of enrollmentEndDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentEndDate", + SerializedName = @"enrollmentEndDate", + PossibleTypes = new [] { typeof(string) })] + string EnrollmentEndDate { get; set; } + /// enrollment number + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"enrollment number", + SerializedName = @"enrollmentNumber", + PossibleTypes = new [] { typeof(string) })] + string EnrollmentNumber { get; set; } + /// datetime of enrollmentStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentStartDate", + SerializedName = @"enrollmentStartDate", + PossibleTypes = new [] { typeof(string) })] + string EnrollmentStartDate { get; set; } + /// invoicing threshold + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"invoicing threshold", + SerializedName = @"invoicingThreshold", + PossibleTypes = new [] { typeof(decimal) })] + decimal? InvoicingThreshold { get; set; } + /// array of meters to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of meters to filter by", + SerializedName = @"meterFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] MeterFilter { get; set; } + /// operator used to compare currentSpend with amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operator used to compare currentSpend with amount", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? Operator { get; set; } + /// overriding alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"overriding alert", + SerializedName = @"overridingAlert", + PossibleTypes = new [] { typeof(string) })] + string OverridingAlert { get; set; } + /// datetime of periodStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of periodStartDate", + SerializedName = @"periodStartDate", + PossibleTypes = new [] { typeof(string) })] + string PeriodStartDate { get; set; } + /// array of resources to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resources to filter by", + SerializedName = @"resourceFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] ResourceFilter { get; set; } + /// array of resourceGroups to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resourceGroups to filter by", + SerializedName = @"resourceGroupFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] ResourceGroupFilter { get; set; } + /// tags to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"tags to filter by", + SerializedName = @"tagFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny TagFilter { get; set; } + /// notification threshold percentage as a decimal which activated this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notification threshold percentage as a decimal which activated this alert", + SerializedName = @"threshold", + PossibleTypes = new [] { typeof(decimal) })] + decimal? Threshold { get; set; } + /// Type of timegrain cadence + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of timegrain cadence", + SerializedName = @"timeGrainType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType? TimeGrainType { get; set; } + /// notificationId that triggered this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notificationId that triggered this alert", + SerializedName = @"triggeredBy", + PossibleTypes = new [] { typeof(string) })] + string TriggeredBy { get; set; } + /// unit of currency being used + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"unit of currency being used", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string Unit { get; set; } + + } + /// Alert details + internal partial interface IAlertPropertiesDetailsInternal + + { + /// budget threshold amount + decimal? Amount { get; set; } + /// company name + string CompanyName { get; set; } + /// list of emails to contact + string[] ContactEmail { get; set; } + /// list of action groups to broadcast to + string[] ContactGroup { get; set; } + /// list of contact roles + string[] ContactRole { get; set; } + /// current spend + decimal? CurrentSpend { get; set; } + /// department name + string DepartmentName { get; set; } + /// datetime of enrollmentEndDate + string EnrollmentEndDate { get; set; } + /// enrollment number + string EnrollmentNumber { get; set; } + /// datetime of enrollmentStartDate + string EnrollmentStartDate { get; set; } + /// invoicing threshold + decimal? InvoicingThreshold { get; set; } + /// array of meters to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] MeterFilter { get; set; } + /// operator used to compare currentSpend with amount + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? Operator { get; set; } + /// overriding alert + string OverridingAlert { get; set; } + /// datetime of periodStartDate + string PeriodStartDate { get; set; } + /// array of resources to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] ResourceFilter { get; set; } + /// array of resourceGroups to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] ResourceGroupFilter { get; set; } + /// tags to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertTimeGrainType? TimeGrainType { get; set; } + /// notificationId that triggered this alert + string TriggeredBy { get; set; } + /// unit of currency being used + string Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.json.cs new file mode 100644 index 000000000000..c8a9bee65cf4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertPropertiesDetails.json.cs @@ -0,0 +1,198 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Alert details + public partial class AlertPropertiesDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal AlertPropertiesDetails(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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.Cost.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.Cost.Models.IAny) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Any.FromJson(__u) )) ))() : null : ResourceGroupFilter;} + {_resourceFilter = If( json?.PropertyT("resourceFilter"), out var __jsonResourceFilter) ? If( __jsonResourceFilter as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.IAny) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Any.FromJson(__p) )) ))() : null : ResourceFilter;} + {_meterFilter = If( json?.PropertyT("meterFilter"), out var __jsonMeterFilter) ? If( __jsonMeterFilter as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Any.FromJson(__k) )) ))() : null : MeterFilter;} + {_tagFilter = If( json?.PropertyT("tagFilter"), out var __jsonTagFilter) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.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.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IAlertPropertiesDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new AlertPropertiesDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._timeGrainType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._timeGrainType.ToString()) : null, "timeGrainType" ,container.Add ); + AddIf( null != (((object)this._periodStartDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._periodStartDate.ToString()) : null, "periodStartDate" ,container.Add ); + AddIf( null != (((object)this._triggeredBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._triggeredBy.ToString()) : null, "triggeredBy" ,container.Add ); + if (null != this._resourceGroupFilter) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceGroupFilter ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("resourceGroupFilter",__w); + } + if (null != this._resourceFilter) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __s in this._resourceFilter ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("resourceFilter",__r); + } + if (null != this._meterFilter) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __n in this._meterFilter ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("meterFilter",__m); + } + AddIf( null != this._tagFilter ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._tagFilter.ToJson(null,serializationMode) : null, "tagFilter" ,container.Add ); + AddIf( null != this._threshold ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNumber((decimal)this._threshold) : null, "threshold" ,container.Add ); + AddIf( null != (((object)this._operator)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._operator.ToString()) : null, "operator" ,container.Add ); + AddIf( null != this._amount ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNumber((decimal)this._amount) : null, "amount" ,container.Add ); + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + AddIf( null != this._currentSpend ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNumber((decimal)this._currentSpend) : null, "currentSpend" ,container.Add ); + if (null != this._contactEmail) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __i in this._contactEmail ) + { + AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__i.ToString()) : null ,__h.Add); + } + container.Add("contactEmails",__h); + } + if (null != this._contactGroup) + { + var __c = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __d in this._contactGroup ) + { + AddIf(null != (((object)__d)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__d.ToString()) : null ,__c.Add); + } + container.Add("contactGroups",__c); + } + if (null != this._contactRole) + { + var ___x = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var ___y in this._contactRole ) + { + AddIf(null != (((object)___y)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(___y.ToString()) : null ,___x.Add); + } + container.Add("contactRoles",___x); + } + AddIf( null != (((object)this._overridingAlert)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._overridingAlert.ToString()) : null, "overridingAlert" ,container.Add ); + AddIf( null != (((object)this._departmentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._departmentName.ToString()) : null, "departmentName" ,container.Add ); + AddIf( null != (((object)this._companyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._companyName.ToString()) : null, "companyName" ,container.Add ); + AddIf( null != (((object)this._enrollmentNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._enrollmentNumber.ToString()) : null, "enrollmentNumber" ,container.Add ); + AddIf( null != (((object)this._enrollmentStartDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._enrollmentStartDate.ToString()) : null, "enrollmentStartDate" ,container.Add ); + AddIf( null != (((object)this._enrollmentEndDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._enrollmentEndDate.ToString()) : null, "enrollmentEndDate" ,container.Add ); + AddIf( null != this._invoicingThreshold ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNumber((decimal)this._invoicingThreshold) : null, "invoicingThreshold" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.PowerShell.cs new file mode 100644 index 000000000000..954541363cf0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Result of alerts. + [System.ComponentModel.TypeConverter(typeof(AlertsResultTypeConverter))] + public partial class AlertsResult + { + + /// + /// 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 AlertsResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal)this).NextLink, 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 AlertsResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal)this).NextLink, 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.Cost.Models.Api20211001.IAlertsResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AlertsResult(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.Cost.Models.Api20211001.IAlertsResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertsResult(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.Cost.Models.Api20211001.IAlertsResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of alerts. + [System.ComponentModel.TypeConverter(typeof(AlertsResultTypeConverter))] + public partial interface IAlertsResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.TypeConverter.cs new file mode 100644 index 000000000000..a1ef056804c9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AlertsResultTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AlertsResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AlertsResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AlertsResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.cs new file mode 100644 index 000000000000..4394929e3043 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.cs @@ -0,0 +1,74 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Result of alerts. + public partial class AlertsResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// URL to get the next set of alerts results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert[] _value; + + /// List of alerts. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert[] Value { get => this._value; } + + /// Creates an new instance. + public AlertsResult() + { + + } + } + /// Result of alerts. + public partial interface IAlertsResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// URL to get the next set of alerts results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"URL to get the next set of alerts results if there are any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// List of alerts. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of alerts.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert[] Value { get; } + + } + /// Result of alerts. + internal 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.Cost.Models.Api20211001.IAlert[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.json.cs new file mode 100644 index 000000000000..df97b62a09f1 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/AlertsResult.json.cs @@ -0,0 +1,124 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Result of alerts. + public partial class AlertsResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal AlertsResult(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IAlert) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IAlertsResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new AlertsResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.PowerShell.cs new file mode 100644 index 000000000000..40b031593877 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.PowerShell.cs @@ -0,0 +1,312 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.ICommonExportProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.TypeConverter.cs new file mode 100644 index 000000000000..209da02564df --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CommonExportPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CommonExportProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CommonExportProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CommonExportProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.cs new file mode 100644 index 000000000000..7e05e89acad1 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.cs @@ -0,0 +1,393 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The common properties of the export. + public partial class CommonExportProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition _definition; + + /// Has the definition for the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).Timeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).Type = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo _deliveryInfo; + + /// Has delivery information for the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo DeliveryInfo { get => (this._deliveryInfo = this._deliveryInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationResourceId = value ?? null; } + + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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 + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).DestinationStorageAccount = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? _format; + + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? Format { get => this._format; set => this._format = value; } + + /// Internal Acessors for DataSetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).DataSetConfiguration = value; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinition()); set { {_definition = value;} } } + + /// Internal Acessors for DefinitionDataSet + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).DataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).DataSet = value; } + + /// Internal Acessors for DefinitionTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriod = value; } + + /// Internal Acessors for DeliveryInfo + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.DeliveryInfo { get => (this._deliveryInfo = this._deliveryInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfo()); set { {_deliveryInfo = value;} } } + + /// Internal Acessors for DeliveryInfoDestination + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)DeliveryInfo).Destination = value; } + + /// Internal Acessors for NextRunTimeEstimate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.NextRunTimeEstimate { get => this._nextRunTimeEstimate; set { {_nextRunTimeEstimate = value;} } } + + /// Internal Acessors for RunHistory + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.RunHistory { get => (this._runHistory = this._runHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResult()); set { {_runHistory = value;} } } + + /// Internal Acessors for RunHistoryValue + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResultInternal)RunHistory).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResultInternal)RunHistory).Value = value; } + + /// Backing field for property. + private global::System.DateTime? _nextRunTimeEstimate; + + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? NextRunTimeEstimate { get => this._nextRunTimeEstimate; } + + /// Backing field for property. + private bool? _partitionData; + + /// + /// If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file. + /// Note: this option is currently available only for modern commerce scopes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public bool? PartitionData { get => this._partitionData; set => this._partitionData = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult _runHistory; + + /// If requested, has the most recent execution history for the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult RunHistory { get => (this._runHistory = this._runHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResult()); set => this._runHistory = value; } + + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResultInternal)RunHistory).Value; } + + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriodFrom = value ?? default(global::System.DateTime); } + + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)Definition).TimePeriodTo = value ?? default(global::System.DateTime); } + + /// Creates an new instance. + public CommonExportProperties() + { + + } + } + /// The common properties of the export. + public partial interface ICommonExportProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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.Cost.Runtime.Info( + Required = true, + 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.Cost.Support.TimeframeType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType 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.Cost.Runtime.Info( + Required = true, + 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.Cost.Support.ExportType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType 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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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) })] + string DestinationContainer { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the directory where exports will be uploaded.", + SerializedName = @"rootFolderPath", + PossibleTypes = new [] { typeof(string) })] + string DestinationRootFolderPath { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationSasToken { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationStorageAccount { get; set; } + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? Format { get; set; } + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If the export has an active schedule, provides an estimate of the next execution time.", + SerializedName = @"nextRunTimeEstimate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? NextRunTimeEstimate { get; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + bool? PartitionData { get; set; } + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of export executions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get; } + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date for export data.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for export data.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodTo { get; set; } + + } + /// The common properties of the export. + internal 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; } + /// The export dataset configuration. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get; set; } + /// Has the definition for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition Definition { get; set; } + /// The definition for data in the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset DefinitionDataSet { get; set; } + /// Has time period for pulling data for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Support.TimeframeType 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.Cost.Support.ExportType DefinitionType { get; set; } + /// Has delivery information for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo DeliveryInfo { get; set; } + /// Has destination for the export being delivered. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get; set; } + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + string DestinationContainer { get; set; } + /// + /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount + /// are specified. + /// + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + string DestinationRootFolderPath { get; set; } + /// + /// 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. + /// + string DestinationSasToken { get; set; } + /// + /// 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. + /// + string DestinationStorageAccount { get; set; } + /// The format of the export being delivered. Currently only 'Csv' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? Format { get; set; } + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + global::System.DateTime? NextRunTimeEstimate { get; set; } + /// + /// 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. + /// + bool? PartitionData { get; set; } + /// If requested, has the most recent execution history for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult RunHistory { get; set; } + /// A list of export executions. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get; set; } + /// The start date for export data. + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + global::System.DateTime? TimePeriodTo { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.json.cs new file mode 100644 index 000000000000..576f09607c37 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/CommonExportProperties.json.cs @@ -0,0 +1,121 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The common properties of the export. + public partial class CommonExportProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal CommonExportProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_deliveryInfo = If( json?.PropertyT("deliveryInfo"), out var __jsonDeliveryInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfo.FromJson(__jsonDeliveryInfo) : DeliveryInfo;} + {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinition.FromJson(__jsonDefinition) : Definition;} + {_runHistory = If( json?.PropertyT("runHistory"), out var __jsonRunHistory) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new CommonExportProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._deliveryInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._deliveryInfo.ToJson(null,serializationMode) : null, "deliveryInfo" ,container.Add ); + AddIf( null != this._definition ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._definition.ToJson(null,serializationMode) : null, "definition" ,container.Add ); + AddIf( null != this._runHistory ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._runHistory.ToJson(null,serializationMode) : null, "runHistory" ,container.Add ); + AddIf( null != (((object)this._format)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._format.ToString()) : null, "format" ,container.Add ); + AddIf( null != this._partitionData ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonBoolean((bool)this._partitionData) : null, "partitionData" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._nextRunTimeEstimate ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._nextRunTimeEstimate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "nextRunTimeEstimate" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.PowerShell.cs new file mode 100644 index 000000000000..836c6bbe4b48 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.PowerShell.cs @@ -0,0 +1,272 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// List of Dimension. + [System.ComponentModel.TypeConverter(typeof(DimensionTypeConverter))] + public partial class Dimension + { + + /// + /// 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.Cost.Models.Api20211001.IDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Dimension(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.Cost.Models.Api20211001.IDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Dimension(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Dimension(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.Cost.Models.Api20211001.IDimensionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("FilterEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GroupingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Data")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Data = (string[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Total")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).NextLink, 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 Dimension(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.Cost.Models.Api20211001.IDimensionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("FilterEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GroupingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Data")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Data = (string[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Total")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal)this).NextLink, 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.Cost.Models.Api20211001.IDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of Dimension. + [System.ComponentModel.TypeConverter(typeof(DimensionTypeConverter))] + public partial interface IDimension + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.TypeConverter.cs new file mode 100644 index 000000000000..f888b5d2fc07 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DimensionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Dimension.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Dimension.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Dimension.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.cs new file mode 100644 index 000000000000..0fbbf9d148f5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.cs @@ -0,0 +1,263 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// List of Dimension. + public partial class Dimension : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Resource(); + + /// Dimension category. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Category; } + + /// Dimension data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] Data { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Data; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Data = value ?? null /* arrayOf */; } + + /// Dimension description. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Description; } + + /// ETag of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).ETag; } + + /// Filter enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public bool? FilterEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).FilterEnabled; } + + /// Grouping enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public bool? GroupingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).GroupingEnabled; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Location; } + + /// Internal Acessors for Category + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal.Category { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Category; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Category = value; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Description = value; } + + /// Internal Acessors for FilterEnabled + bool? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal.FilterEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).FilterEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).FilterEnabled = value; } + + /// Internal Acessors for GroupingEnabled + bool? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal.GroupingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).GroupingEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).GroupingEnabled = value; } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal.NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).NextLink = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionProperties()); set { {_property = value;} } } + + /// Internal Acessors for Total + int? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal.Total { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Total; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Total = value; } + + /// Internal Acessors for UsageEnd + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal.UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageEnd = value; } + + /// Internal Acessors for UsageStart + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionInternal.UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageStart = value; } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).ETag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Location = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Sku + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Sku = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).NextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties _property; + + /// Dimension properties. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionProperties()); set => this._property = value; } + + /// SKU of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Sku; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Total number of data for the dimension. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public int? Total { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).Total; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// Usage end. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? UsageEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageEnd; } + + /// Usage start. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? UsageStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)Property).UsageStart; } + + /// Creates an new instance. + public Dimension() + { + + } + + /// 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.Cost.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// List of Dimension. + public partial interface IDimension : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource + { + /// Dimension category. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Dimension category.", + SerializedName = @"category", + PossibleTypes = new [] { typeof(string) })] + string Category { get; } + /// Dimension data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dimension data.", + SerializedName = @"data", + PossibleTypes = new [] { typeof(string) })] + string[] Data { get; set; } + /// Dimension description. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Dimension description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// Filter enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Filter enabled.", + SerializedName = @"filterEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterEnabled { get; } + /// Grouping enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Grouping enabled.", + SerializedName = @"groupingEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? GroupingEnabled { get; } + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The link (url) to the next page of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Total number of data for the dimension. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of data for the dimension.", + SerializedName = @"total", + PossibleTypes = new [] { typeof(int) })] + int? Total { get; } + /// Usage end. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage end.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageEnd { get; } + /// Usage start. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage start.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageStart { get; } + + } + /// List of Dimension. + internal partial interface IDimensionInternal : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal + { + /// Dimension category. + string Category { get; set; } + /// Dimension data. + string[] Data { get; set; } + /// Dimension description. + string Description { get; set; } + /// Filter enabled. + bool? FilterEnabled { get; set; } + /// Grouping enabled. + bool? GroupingEnabled { get; set; } + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// Dimension properties. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties Property { get; set; } + /// Total number of data for the dimension. + int? Total { get; set; } + /// Usage end. + global::System.DateTime? UsageEnd { get; set; } + /// Usage start. + global::System.DateTime? UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.json.cs new file mode 100644 index 000000000000..db14b5226ff3 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Dimension.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// List of Dimension. + public partial class Dimension + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal Dimension(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new Dimension(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.PowerShell.cs new file mode 100644 index 000000000000..d5e3d1457254 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.PowerShell.cs @@ -0,0 +1,208 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Dimension properties. + [System.ComponentModel.TypeConverter(typeof(DimensionPropertiesTypeConverter))] + public partial class DimensionProperties + { + + /// + /// 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.Cost.Models.Api20211001.IDimensionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DimensionProperties(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.Cost.Models.Api20211001.IDimensionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DimensionProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DimensionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("FilterEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GroupingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Data")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Data = (string[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Total")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).NextLink, 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 DimensionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("FilterEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).FilterEnabled = (bool?) content.GetValueForProperty("FilterEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).FilterEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GroupingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).GroupingEnabled = (bool?) content.GetValueForProperty("GroupingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).GroupingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Data")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Data = (string[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Total")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Total = (int?) content.GetValueForProperty("Total",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Total, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("UsageStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).UsageStart = (global::System.DateTime?) content.GetValueForProperty("UsageStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("UsageEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).UsageEnd = (global::System.DateTime?) content.GetValueForProperty("UsageEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal)this).NextLink, 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.Cost.Models.Api20211001.IDimensionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Dimension properties. + [System.ComponentModel.TypeConverter(typeof(DimensionPropertiesTypeConverter))] + public partial interface IDimensionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.TypeConverter.cs new file mode 100644 index 000000000000..ec65e8656da7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DimensionPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DimensionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DimensionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DimensionProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.cs new file mode 100644 index 000000000000..9be1953f84dd --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.cs @@ -0,0 +1,211 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Dimension properties. + public partial class DimensionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal + { + + /// Backing field for property. + private string _category; + + /// Dimension category. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Category { get => this._category; } + + /// Backing field for property. + private string[] _data; + + /// Dimension data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] Data { get => this._data; set => this._data = value; } + + /// Backing field for property. + private string _description; + + /// Dimension description. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private bool? _filterEnabled; + + /// Filter enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public bool? FilterEnabled { get => this._filterEnabled; } + + /// Backing field for property. + private bool? _groupingEnabled; + + /// Grouping enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public bool? GroupingEnabled { get => this._groupingEnabled; } + + /// Internal Acessors for Category + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal.Category { get => this._category; set { {_category = value;} } } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for FilterEnabled + bool? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal.FilterEnabled { get => this._filterEnabled; set { {_filterEnabled = value;} } } + + /// Internal Acessors for GroupingEnabled + bool? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal.GroupingEnabled { get => this._groupingEnabled; set { {_groupingEnabled = value;} } } + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Total + int? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal.Total { get => this._total; set { {_total = value;} } } + + /// Internal Acessors for UsageEnd + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal.UsageEnd { get => this._usageEnd; set { {_usageEnd = value;} } } + + /// Internal Acessors for UsageStart + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionPropertiesInternal.UsageStart { get => this._usageStart; set { {_usageStart = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private int? _total; + + /// Total number of data for the dimension. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public int? Total { get => this._total; } + + /// Backing field for property. + private global::System.DateTime? _usageEnd; + + /// Usage end. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? UsageEnd { get => this._usageEnd; } + + /// Backing field for property. + private global::System.DateTime? _usageStart; + + /// Usage start. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? UsageStart { get => this._usageStart; } + + /// Creates an new instance. + public DimensionProperties() + { + + } + } + /// Dimension properties. + public partial interface IDimensionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Dimension category. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Dimension category.", + SerializedName = @"category", + PossibleTypes = new [] { typeof(string) })] + string Category { get; } + /// Dimension data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dimension data.", + SerializedName = @"data", + PossibleTypes = new [] { typeof(string) })] + string[] Data { get; set; } + /// Dimension description. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Dimension description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// Filter enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Filter enabled.", + SerializedName = @"filterEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterEnabled { get; } + /// Grouping enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Grouping enabled.", + SerializedName = @"groupingEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? GroupingEnabled { get; } + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The link (url) to the next page of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Total number of data for the dimension. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Total number of data for the dimension.", + SerializedName = @"total", + PossibleTypes = new [] { typeof(int) })] + int? Total { get; } + /// Usage end. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage end.", + SerializedName = @"usageEnd", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageEnd { get; } + /// Usage start. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Usage start.", + SerializedName = @"usageStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? UsageStart { get; } + + } + /// Dimension properties. + internal partial interface IDimensionPropertiesInternal + + { + /// Dimension category. + string Category { get; set; } + /// Dimension data. + string[] Data { get; set; } + /// Dimension description. + string Description { get; set; } + /// Filter enabled. + bool? FilterEnabled { get; set; } + /// Grouping enabled. + bool? GroupingEnabled { get; set; } + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// Total number of data for the dimension. + int? Total { get; set; } + /// Usage end. + global::System.DateTime? UsageEnd { get; set; } + /// Usage start. + global::System.DateTime? UsageStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.json.cs new file mode 100644 index 000000000000..527956140576 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionProperties.json.cs @@ -0,0 +1,156 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Dimension properties. + public partial class DimensionProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal DimensionProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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.Cost.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.Cost.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.Cost.Models.Api20211001.IDimensionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new DimensionProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._filterEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonBoolean((bool)this._filterEnabled) : null, "filterEnabled" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._groupingEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonBoolean((bool)this._groupingEnabled) : null, "groupingEnabled" ,container.Add ); + } + if (null != this._data) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._data ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("data",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._total ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNumber((int)this._total) : null, "total" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._category.ToString()) : null, "category" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usageStart ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._usageEnd ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.PowerShell.cs new file mode 100644 index 000000000000..f4a16e9ecf75 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.PowerShell.cs @@ -0,0 +1,144 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Result of listing dimensions. It contains a list of available dimensions. + [System.ComponentModel.TypeConverter(typeof(DimensionsListResultTypeConverter))] + public partial class DimensionsListResult + { + + /// + /// 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.Cost.Models.Api20211001.IDimensionsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DimensionsListResult(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.Cost.Models.Api20211001.IDimensionsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DimensionsListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DimensionsListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DimensionsListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DimensionTypeConverter.ConvertFrom)); + } + 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.Cost.Models.Api20211001.IDimensionsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing dimensions. It contains a list of available dimensions. + [System.ComponentModel.TypeConverter(typeof(DimensionsListResultTypeConverter))] + public partial interface IDimensionsListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.TypeConverter.cs new file mode 100644 index 000000000000..102cbcd2ea97 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DimensionsListResultTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DimensionsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DimensionsListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DimensionsListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.cs new file mode 100644 index 000000000000..a52d26b379b3 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.cs @@ -0,0 +1,54 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Result of listing dimensions. It contains a list of available dimensions. + public partial class DimensionsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResult, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResultInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension[] _value; + + /// The list of dimensions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension[] Value { get => this._value; } + + /// Creates an new instance. + public DimensionsListResult() + { + + } + } + /// Result of listing dimensions. It contains a list of available dimensions. + public partial interface IDimensionsListResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The list of dimensions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of dimensions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension[] Value { get; } + + } + /// Result of listing dimensions. It contains a list of available dimensions. + internal partial interface IDimensionsListResultInternal + + { + /// The list of dimensions. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.json.cs new file mode 100644 index 000000000000..472a76027b43 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DimensionsListResult.json.cs @@ -0,0 +1,119 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Result of listing dimensions. It contains a list of available dimensions. + public partial class DimensionsListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal DimensionsListResult(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IDimension) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Dimension.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimensionsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new DimensionsListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.PowerShell.cs new file mode 100644 index 000000000000..d6d7e41ba5dc --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.PowerShell.cs @@ -0,0 +1,432 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource.CreateFrom); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType.CreateFrom); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory.CreateFrom); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria.CreateFrom); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType.CreateFrom); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailMeterFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator.CreateFrom); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Detail, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertPropertiesDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource.CreateFrom); + } + if (content.Contains("CostEntityId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CostEntityId = (string) content.GetValueForProperty("CostEntityId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CostEntityId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("CloseTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CloseTime = (string) content.GetValueForProperty("CloseTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).CloseTime, global::System.Convert.ToString); + } + if (content.Contains("ModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).ModificationTime = (string) content.GetValueForProperty("ModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).ModificationTime, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationUserName = (string) content.GetValueForProperty("StatusModificationUserName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationUserName, global::System.Convert.ToString); + } + if (content.Contains("StatusModificationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationTime = (string) content.GetValueForProperty("StatusModificationTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).StatusModificationTime, global::System.Convert.ToString); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType?) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType.CreateFrom); + } + if (content.Contains("DefinitionCategory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCategory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory?) content.GetValueForProperty("DefinitionCategory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCategory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory.CreateFrom); + } + if (content.Contains("DefinitionCriterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCriterion = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria?) content.GetValueForProperty("DefinitionCriterion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DefinitionCriterion, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria.CreateFrom); + } + if (content.Contains("DetailTimeGrainType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTimeGrainType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType?) content.GetValueForProperty("DetailTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTimeGrainType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType.CreateFrom); + } + if (content.Contains("DetailPeriodStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailPeriodStartDate = (string) content.GetValueForProperty("DetailPeriodStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailPeriodStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailTriggeredBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTriggeredBy = (string) content.GetValueForProperty("DetailTriggeredBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTriggeredBy, global::System.Convert.ToString); + } + if (content.Contains("DetailResourceGroupFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceGroupFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceGroupFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailResourceFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailResourceFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailResourceFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailMeterFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailMeterFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[]) content.GetValueForProperty("DetailMeterFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailMeterFilter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailTagFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTagFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) content.GetValueForProperty("DetailTagFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailTagFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailThreshold = (decimal?) content.GetValueForProperty("DetailThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailThreshold, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator?) content.GetValueForProperty("DetailOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator.CreateFrom); + } + if (content.Contains("DetailAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailAmount = (decimal?) content.GetValueForProperty("DetailAmount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailAmount, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailUnit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailUnit = (string) content.GetValueForProperty("DetailUnit",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailUnit, global::System.Convert.ToString); + } + if (content.Contains("DetailCurrentSpend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCurrentSpend = (decimal?) content.GetValueForProperty("DetailCurrentSpend",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCurrentSpend, (__y)=> (decimal) global::System.Convert.ChangeType(__y, typeof(decimal))); + } + if (content.Contains("DetailContactEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactEmail = (string[]) content.GetValueForProperty("DetailContactEmail",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactGroup = (string[]) content.GetValueForProperty("DetailContactGroup",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailContactRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactRole = (string[]) content.GetValueForProperty("DetailContactRole",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailContactRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailOverridingAlert")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOverridingAlert = (string) content.GetValueForProperty("DetailOverridingAlert",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailOverridingAlert, global::System.Convert.ToString); + } + if (content.Contains("DetailDepartmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailDepartmentName = (string) content.GetValueForProperty("DetailDepartmentName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailDepartmentName, global::System.Convert.ToString); + } + if (content.Contains("DetailCompanyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCompanyName = (string) content.GetValueForProperty("DetailCompanyName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailCompanyName, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber = (string) content.GetValueForProperty("DetailEnrollmentNumber",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentNumber, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate = (string) content.GetValueForProperty("DetailEnrollmentStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentStartDate, global::System.Convert.ToString); + } + if (content.Contains("DetailEnrollmentEndDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate = (string) content.GetValueForProperty("DetailEnrollmentEndDate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailEnrollmentEndDate, global::System.Convert.ToString); + } + if (content.Contains("DetailInvoicingThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal)this).DetailInvoicingThreshold = (decimal?) content.GetValueForProperty("DetailInvoicingThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IDismissAlertPayload FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.TypeConverter.cs new file mode 100644 index 000000000000..f9d04846f752 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DismissAlertPayloadTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DismissAlertPayload.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DismissAlertPayload.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DismissAlertPayload.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.cs new file mode 100644 index 000000000000..7729e88adc20 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.cs @@ -0,0 +1,532 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The request payload to update an alert + public partial class DismissAlertPayload : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal + { + + /// dateTime in which alert was closed + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string CloseTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CloseTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CloseTime = value ?? null; } + + /// related budget + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string CostEntityId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CostEntityId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CostEntityId = value ?? null; } + + /// dateTime in which alert was created + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).CreationTime = value ?? null; } + + /// Alert category + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? DefinitionCategory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCategory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCategory = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory)""); } + + /// Criteria that triggered alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? DefinitionCriterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCriterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionCriterion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria)""); } + + /// type of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType)""); } + + /// Alert description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Description = value ?? null; } + + /// budget threshold amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailAmount = value ?? default(decimal); } + + /// company name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailCompanyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCompanyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCompanyName = value ?? null; } + + /// list of emails to contact + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DetailContactEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactEmail = value ?? null /* arrayOf */; } + + /// list of action groups to broadcast to + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DetailContactGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactGroup = value ?? null /* arrayOf */; } + + /// list of contact roles + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DetailContactRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailContactRole = value ?? null /* arrayOf */; } + + /// current spend + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailCurrentSpend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCurrentSpend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailCurrentSpend = value ?? default(decimal); } + + /// department name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailDepartmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailDepartmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailDepartmentName = value ?? null; } + + /// datetime of enrollmentEndDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailEnrollmentEndDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentEndDate = value ?? null; } + + /// enrollment number + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailEnrollmentNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentNumber = value ?? null; } + + /// datetime of enrollmentStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailEnrollmentStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailEnrollmentStartDate = value ?? null; } + + /// invoicing threshold + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailInvoicingThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailInvoicingThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailInvoicingThreshold = value ?? default(decimal); } + + /// array of meters to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailMeterFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailMeterFilter = value ?? null /* arrayOf */; } + + /// operator used to compare currentSpend with amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? DetailOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOperator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator)""); } + + /// overriding alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailOverridingAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOverridingAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailOverridingAlert = value ?? null; } + + /// datetime of periodStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailPeriodStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailPeriodStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailPeriodStartDate = value ?? null; } + + /// array of resources to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceFilter = value ?? null /* arrayOf */; } + + /// array of resourceGroups to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceGroupFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailResourceGroupFilter = value ?? null /* arrayOf */; } + + /// tags to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny DetailTagFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTagFilter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTagFilter = value ?? null /* model class */; } + + /// notification threshold percentage as a decimal which activated this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public decimal? DetailThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailThreshold = value ?? default(decimal); } + + /// Type of timegrain cadence + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType? DetailTimeGrainType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTimeGrainType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTimeGrainType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType)""); } + + /// notificationId that triggered this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailTriggeredBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTriggeredBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailTriggeredBy = value ?? null; } + + /// unit of currency being used + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DetailUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).DetailUnit = value ?? null; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Definition = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Detail = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayloadInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertProperties()); set { {_property = value;} } } + + /// dateTime in which alert was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string ModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).ModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).ModificationTime = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties _property; + + /// Alert properties. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertProperties()); set => this._property = value; } + + /// Source of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Source = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource)""); } + + /// alert status + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus)""); } + + /// dateTime in which the alert status was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string StatusModificationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationTime = value ?? null; } + + /// User who last modified the alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string StatusModificationUserName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationUserName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesInternal)Property).StatusModificationUserName = value ?? null; } + + /// Creates an new instance. + public DismissAlertPayload() + { + + } + } + /// The request payload to update an alert + public partial interface IDismissAlertPayload : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// dateTime in which alert was closed + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was closed", + SerializedName = @"closeTime", + PossibleTypes = new [] { typeof(string) })] + string CloseTime { get; set; } + /// related budget + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"related budget", + SerializedName = @"costEntityId", + PossibleTypes = new [] { typeof(string) })] + string CostEntityId { get; set; } + /// dateTime in which alert was created + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was created", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(string) })] + string CreationTime { get; set; } + /// Alert category + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert category", + SerializedName = @"category", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? DefinitionCategory { get; set; } + /// Criteria that triggered alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Criteria that triggered alert", + SerializedName = @"criteria", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? DefinitionCriterion { get; set; } + /// type of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"type of alert", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? DefinitionType { get; set; } + /// Alert description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// budget threshold amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"budget threshold amount", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailAmount { get; set; } + /// company name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"company name", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + string DetailCompanyName { get; set; } + /// list of emails to contact + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of emails to contact", + SerializedName = @"contactEmails", + PossibleTypes = new [] { typeof(string) })] + string[] DetailContactEmail { get; set; } + /// list of action groups to broadcast to + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of action groups to broadcast to", + SerializedName = @"contactGroups", + PossibleTypes = new [] { typeof(string) })] + string[] DetailContactGroup { get; set; } + /// list of contact roles + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of contact roles", + SerializedName = @"contactRoles", + PossibleTypes = new [] { typeof(string) })] + string[] DetailContactRole { get; set; } + /// current spend + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"current spend", + SerializedName = @"currentSpend", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailCurrentSpend { get; set; } + /// department name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"department name", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + string DetailDepartmentName { get; set; } + /// datetime of enrollmentEndDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentEndDate", + SerializedName = @"enrollmentEndDate", + PossibleTypes = new [] { typeof(string) })] + string DetailEnrollmentEndDate { get; set; } + /// enrollment number + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"enrollment number", + SerializedName = @"enrollmentNumber", + PossibleTypes = new [] { typeof(string) })] + string DetailEnrollmentNumber { get; set; } + /// datetime of enrollmentStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentStartDate", + SerializedName = @"enrollmentStartDate", + PossibleTypes = new [] { typeof(string) })] + string DetailEnrollmentStartDate { get; set; } + /// invoicing threshold + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"invoicing threshold", + SerializedName = @"invoicingThreshold", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailInvoicingThreshold { get; set; } + /// array of meters to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of meters to filter by", + SerializedName = @"meterFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get; set; } + /// operator used to compare currentSpend with amount + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operator used to compare currentSpend with amount", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? DetailOperator { get; set; } + /// overriding alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"overriding alert", + SerializedName = @"overridingAlert", + PossibleTypes = new [] { typeof(string) })] + string DetailOverridingAlert { get; set; } + /// datetime of periodStartDate + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of periodStartDate", + SerializedName = @"periodStartDate", + PossibleTypes = new [] { typeof(string) })] + string DetailPeriodStartDate { get; set; } + /// array of resources to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resources to filter by", + SerializedName = @"resourceFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get; set; } + /// array of resourceGroups to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resourceGroups to filter by", + SerializedName = @"resourceGroupFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get; set; } + /// tags to filter by + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"tags to filter by", + SerializedName = @"tagFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny DetailTagFilter { get; set; } + /// notification threshold percentage as a decimal which activated this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notification threshold percentage as a decimal which activated this alert", + SerializedName = @"threshold", + PossibleTypes = new [] { typeof(decimal) })] + decimal? DetailThreshold { get; set; } + /// Type of timegrain cadence + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of timegrain cadence", + SerializedName = @"timeGrainType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + /// notificationId that triggered this alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notificationId that triggered this alert", + SerializedName = @"triggeredBy", + PossibleTypes = new [] { typeof(string) })] + string DetailTriggeredBy { get; set; } + /// unit of currency being used + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"unit of currency being used", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string DetailUnit { get; set; } + /// dateTime in which alert was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was last modified", + SerializedName = @"modificationTime", + PossibleTypes = new [] { typeof(string) })] + string ModificationTime { get; set; } + /// Source of alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source of alert", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? Source { get; set; } + /// alert status + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"alert status", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? Status { get; set; } + /// dateTime in which the alert status was last modified + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which the alert status was last modified", + SerializedName = @"statusModificationTime", + PossibleTypes = new [] { typeof(string) })] + string StatusModificationTime { get; set; } + /// User who last modified the alert + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User who last modified the alert", + SerializedName = @"statusModificationUserName", + PossibleTypes = new [] { typeof(string) })] + string StatusModificationUserName { get; set; } + + } + /// The request payload to update an alert + internal partial interface IDismissAlertPayloadInternal + + { + /// dateTime in which alert was closed + string CloseTime { get; set; } + /// related budget + string CostEntityId { get; set; } + /// dateTime in which alert was created + string CreationTime { get; set; } + /// defines the type of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertPropertiesDefinition Definition { get; set; } + /// Alert category + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory? DefinitionCategory { get; set; } + /// Criteria that triggered alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria? DefinitionCriterion { get; set; } + /// type of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType? DefinitionType { get; set; } + /// Alert description + string Description { get; set; } + /// Alert details + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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; } + /// list of action groups to broadcast to + string[] DetailContactGroup { get; set; } + /// list of contact roles + string[] DetailContactRole { get; set; } + /// current spend + decimal? DetailCurrentSpend { get; set; } + /// department name + string DetailDepartmentName { get; set; } + /// datetime of enrollmentEndDate + string DetailEnrollmentEndDate { get; set; } + /// enrollment number + string DetailEnrollmentNumber { get; set; } + /// datetime of enrollmentStartDate + string DetailEnrollmentStartDate { get; set; } + /// invoicing threshold + decimal? DetailInvoicingThreshold { get; set; } + /// array of meters to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get; set; } + /// operator used to compare currentSpend with amount + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator? DetailOperator { get; set; } + /// overriding alert + string DetailOverridingAlert { get; set; } + /// datetime of periodStartDate + string DetailPeriodStartDate { get; set; } + /// array of resources to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get; set; } + /// array of resourceGroups to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get; set; } + /// tags to filter by + Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertTimeGrainType? DetailTimeGrainType { get; set; } + /// notificationId that triggered this alert + string DetailTriggeredBy { get; set; } + /// unit of currency being used + string DetailUnit { get; set; } + /// dateTime in which alert was last modified + string ModificationTime { get; set; } + /// Alert properties. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertProperties Property { get; set; } + /// Source of alert + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource? Source { get; set; } + /// alert status + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus? Status { get; set; } + /// dateTime in which the alert status was last modified + string StatusModificationTime { get; set; } + /// User who last modified the alert + string StatusModificationUserName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.json.cs new file mode 100644 index 000000000000..b4861b3f42cf --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DismissAlertPayload.json.cs @@ -0,0 +1,108 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The request payload to update an alert + public partial class DismissAlertPayload + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal DismissAlertPayload(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.AlertProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new DismissAlertPayload(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.PowerShell.cs new file mode 100644 index 000000000000..cd53084ea961 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The URL to download the generated report. + [System.ComponentModel.TypeConverter(typeof(DownloadUrlTypeConverter))] + public partial class DownloadUrl + { + + /// + /// 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.Cost.Models.Api20211001.IDownloadUrl DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DownloadUrl(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.Cost.Models.Api20211001.IDownloadUrl DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DownloadUrl(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DownloadUrl(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DownloadUrl1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)this).DownloadUrl1 = (string) content.GetValueForProperty("DownloadUrl1",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)this).DownloadUrl1, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)this).ValidTill, (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 DownloadUrl(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DownloadUrl1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)this).DownloadUrl1 = (string) content.GetValueForProperty("DownloadUrl1",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)this).DownloadUrl1, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)this).ValidTill, (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.Cost.Models.Api20211001.IDownloadUrl FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The URL to download the generated report. + [System.ComponentModel.TypeConverter(typeof(DownloadUrlTypeConverter))] + public partial interface IDownloadUrl + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.TypeConverter.cs new file mode 100644 index 000000000000..366e029ce2bb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DownloadUrlTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DownloadUrl.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DownloadUrl.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DownloadUrl.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.cs new file mode 100644 index 000000000000..bde5e1ca1745 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.cs @@ -0,0 +1,74 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The URL to download the generated report. + public partial class DownloadUrl : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal + { + + /// Backing field for property. + private string _downloadUrl1; + + /// The URL to download the generated report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string DownloadUrl1 { get => this._downloadUrl1; set => this._downloadUrl1 = value; } + + /// Backing field for property. + private global::System.DateTime? _validTill; + + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? ValidTill { get => this._validTill; set => this._validTill = value; } + + /// Creates an new instance. + public DownloadUrl() + { + + } + } + /// The URL to download the generated report. + public partial interface IDownloadUrl : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The URL to download the generated report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL to download the generated report.", + SerializedName = @"downloadUrl", + PossibleTypes = new [] { typeof(string) })] + string DownloadUrl1 { get; set; } + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + global::System.DateTime? ValidTill { get; set; } + + } + /// The URL to download the generated report. + internal partial interface IDownloadUrlInternal + + { + /// The URL to download the generated report. + string DownloadUrl1 { get; set; } + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + global::System.DateTime? ValidTill { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.json.cs new file mode 100644 index 000000000000..7ed33323a8bc --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/DownloadUrl.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The URL to download the generated report. + public partial class DownloadUrl + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal DownloadUrl(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_downloadUrl1 = If( json?.PropertyT("downloadUrl"), out var __jsonDownloadUrl) ? (string)__jsonDownloadUrl : (string)DownloadUrl1;} + {_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.Cost.Models.Api20211001.IDownloadUrl. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new DownloadUrl(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._downloadUrl1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._downloadUrl1.ToString()) : null, "downloadUrl" ,container.Add ); + AddIf( null != this._validTill ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._validTill?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "validTill" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.PowerShell.cs new file mode 100644 index 000000000000..c565d644e996 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The details of the error. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailsTypeConverter))] + public partial class ErrorDetails + { + + /// + /// 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.Cost.Models.Api20211001.IErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorDetails(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.Cost.Models.Api20211001.IErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorDetails(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)this).Message, 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 ErrorDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)this).Message, 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.Cost.Models.Api20211001.IErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The details of the error. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailsTypeConverter))] + public partial interface IErrorDetails + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.TypeConverter.cs new file mode 100644 index 000000000000..0ef21d619f85 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorDetailsTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorDetails.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorDetails.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorDetails.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.cs new file mode 100644 index 000000000000..29ba709c31d2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.cs @@ -0,0 +1,74 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The details of the error. + public partial class ErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal + { + + /// Backing field for property. + private string _code; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private string _message; + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal.Message { get => this._message; set { {_message = value;} } } + + /// Creates an new instance. + public ErrorDetails() + { + + } + } + /// The details of the error. + public partial interface IErrorDetails : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + /// The details of the error. + internal partial interface IErrorDetailsInternal + + { + /// Error code. + string Code { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.json.cs new file mode 100644 index 000000000000..383913f13bd9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorDetails.json.cs @@ -0,0 +1,116 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The details of the error. + public partial class ErrorDetails + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ErrorDetails(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..e272c8f4930c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.PowerShell.cs @@ -0,0 +1,174 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + /// + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial class ErrorResponse + { + + /// + /// 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.Cost.Models.Api20211001.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponse(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.Cost.Models.Api20211001.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponse(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Message, 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 ErrorResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal)this).Message, 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.Cost.Models.Api20211001.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial interface IErrorResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..36875e6375e6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.cs new file mode 100644 index 000000000000..2d4ab7aeee88 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.cs @@ -0,0 +1,100 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + /// + public partial class ErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails _error; + + /// The details of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set => this._error = value; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + + /// Creates an new instance. + public ErrorResponse() + { + + } + } + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + public partial interface IErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + internal partial interface IErrorResponseInternal + + { + /// Error code. + string Code { get; set; } + /// The details of the error. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.json.cs new file mode 100644 index 000000000000..71bfb1d9c8ab --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ErrorResponse.json.cs @@ -0,0 +1,116 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + /// + public partial class ErrorResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Export.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Export.PowerShell.cs new file mode 100644 index 000000000000..30407c3c7931 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Export.PowerShell.cs @@ -0,0 +1,400 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IExportInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleRecurrencePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleStatus = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType?) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleStatus, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType.CreateFrom); + } + if (content.Contains("ScheduleRecurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleRecurrence = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType?) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleRecurrence, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType.CreateFrom); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleRecurrencePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleStatus = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType?) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleStatus, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType.CreateFrom); + } + if (content.Contains("ScheduleRecurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleRecurrence = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType?) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).ScheduleRecurrence, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType.CreateFrom); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExport FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/Export.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Export.TypeConverter.cs new file mode 100644 index 000000000000..485f2c98b44f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Export.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Export.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Export.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Export.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/Export.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Export.cs new file mode 100644 index 000000000000..fc88ce5bfcc1 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Export.cs @@ -0,0 +1,497 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// An export resource. + public partial class Export : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); } + + /// + /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType? DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionTimeframe = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType)""); } + + /// + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType)""); } + + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationResourceId = value ?? null; } + + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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 + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? Format { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).Format = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType)""); } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + + /// Internal Acessors for DataSetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DataSetConfiguration = value; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).Definition = value; } + + /// Internal Acessors for DefinitionDataSet + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionDataSet = value; } + + /// Internal Acessors for DefinitionTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DefinitionTimePeriod = value; } + + /// Internal Acessors for DeliveryInfo + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.DeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DeliveryInfo = value; } + + /// Internal Acessors for DeliveryInfoDestination + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).DeliveryInfoDestination = value; } + + /// Internal Acessors for NextRunTimeEstimate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).NextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).NextRunTimeEstimate = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportProperties()); set { {_property = value;} } } + + /// Internal Acessors for RunHistory + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.RunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistory = value; } + + /// Internal Acessors for RunHistoryValue + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistoryValue = value; } + + /// Internal Acessors for Schedule + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.Schedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).Schedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).Schedule = value; } + + /// Internal Acessors for ScheduleRecurrencePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportInternal.ScheduleRecurrencePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleRecurrencePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleRecurrencePeriod = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public bool? PartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).PartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).PartitionData = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties _property; + + /// The properties of the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportProperties()); set => this._property = value; } + + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? RecurrencePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).RecurrencePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).RecurrencePeriodFrom = value ?? default(global::System.DateTime); } + + /// The end date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? RecurrencePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).RecurrencePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).RecurrencePeriodTo = value ?? default(global::System.DateTime); } + + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).RunHistoryValue; } + + /// The schedule recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType? ScheduleRecurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleRecurrence; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleRecurrence = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType)""); } + + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType? ScheduleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)Property).ScheduleStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType)""); } + + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).TimePeriodFrom = value ?? default(global::System.DateTime); } + + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)Property).TimePeriodTo = value ?? default(global::System.DateTime); } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public Export() + { + + } + + /// 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.Cost.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// An export resource. + public partial interface IExport : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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.Cost.Runtime.Info( + Required = false, + 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.Cost.Support.TimeframeType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType? 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.Cost.Runtime.Info( + Required = false, + 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.Cost.Support.ExportType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType? 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationContainer { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the directory where exports will be uploaded.", + SerializedName = @"rootFolderPath", + PossibleTypes = new [] { typeof(string) })] + string DestinationRootFolderPath { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationSasToken { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationStorageAccount { get; set; } + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? Format { get; set; } + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If the export has an active schedule, provides an estimate of the next execution time.", + SerializedName = @"nextRunTimeEstimate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? NextRunTimeEstimate { get; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + bool? PartitionData { get; set; } + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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; } + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of export executions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get; } + /// The schedule recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The schedule recurrence.", + SerializedName = @"recurrence", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType? ScheduleRecurrence { get; set; } + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.StatusType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType? ScheduleStatus { get; set; } + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date for export data.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for export data.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodTo { get; set; } + + } + /// An export resource. + internal partial interface IExportInternal : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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; } + /// The export dataset configuration. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get; set; } + /// Has the definition for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition Definition { get; set; } + /// The definition for data in the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset DefinitionDataSet { get; set; } + /// Has time period for pulling data for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Support.TimeframeType? 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.Cost.Support.ExportType? DefinitionType { get; set; } + /// Has delivery information for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo DeliveryInfo { get; set; } + /// Has destination for the export being delivered. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get; set; } + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + string DestinationContainer { get; set; } + /// + /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount + /// are specified. + /// + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + string DestinationRootFolderPath { get; set; } + /// + /// 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. + /// + string DestinationSasToken { get; set; } + /// + /// 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. + /// + string DestinationStorageAccount { get; set; } + /// The format of the export being delivered. Currently only 'Csv' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? Format { get; set; } + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + global::System.DateTime? NextRunTimeEstimate { get; set; } + /// + /// 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. + /// + bool? PartitionData { get; set; } + /// The properties of the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IExportExecutionListResult RunHistory { get; set; } + /// A list of export executions. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get; set; } + /// Has schedule information for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule Schedule { get; set; } + /// The schedule recurrence. + Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Support.StatusType? ScheduleStatus { get; set; } + /// The start date for export data. + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + global::System.DateTime? TimePeriodTo { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Export.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Export.json.cs new file mode 100644 index 000000000000..901df48deb43 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Export.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// An export resource. + public partial class Export + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal Export(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new Export(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __proxyResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.PowerShell.cs new file mode 100644 index 000000000000..558c3e5158c0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.PowerShell.cs @@ -0,0 +1,160 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The definition for data in the export. + [System.ComponentModel.TypeConverter(typeof(ExportDatasetTypeConverter))] + public partial class ExportDataset + { + + /// + /// 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.Cost.Models.Api20211001.IExportDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportDataset(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.Cost.Models.Api20211001.IExportDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportDataset(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportDataset(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.Cost.Models.Api20211001.IExportDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)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 ExportDataset(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.Cost.Models.Api20211001.IExportDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)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.Cost.Models.Api20211001.IExportDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The definition for data in the export. + [System.ComponentModel.TypeConverter(typeof(ExportDatasetTypeConverter))] + public partial interface IExportDataset + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.TypeConverter.cs new file mode 100644 index 000000000000..769411166c44 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportDatasetTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportDataset.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportDataset.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportDataset.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.cs new file mode 100644 index 000000000000..1bbf38ba325e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.cs @@ -0,0 +1,86 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition for data in the export. + public partial class ExportDataset : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration _configuration; + + /// The export dataset configuration. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? _granularity; + + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? Granularity { get => this._granularity; set => this._granularity = value; } + + /// Internal Acessors for Configuration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfiguration()); set { {_configuration = value;} } } + + /// Creates an new instance. + public ExportDataset() + { + + } + } + /// The definition for data in the export. + public partial interface IExportDataset : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? Granularity { get; set; } + + } + /// The definition for data in the export. + internal partial interface IExportDatasetInternal + + { + /// The export dataset configuration. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? Granularity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.json.cs new file mode 100644 index 000000000000..a3c1154e1763 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDataset.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition for data in the export. + public partial class ExportDataset + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportDataset(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IExportDataset. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportDataset(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._configuration ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._configuration.ToJson(null,serializationMode) : null, "configuration" ,container.Add ); + AddIf( null != (((object)this._granularity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._granularity.ToString()) : null, "granularity" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.PowerShell.cs new file mode 100644 index 000000000000..0e44f6d2577b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.PowerShell.cs @@ -0,0 +1,148 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include + /// all available columns. + /// + [System.ComponentModel.TypeConverter(typeof(ExportDatasetConfigurationTypeConverter))] + public partial class ExportDatasetConfiguration + { + + /// + /// 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.Cost.Models.Api20211001.IExportDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportDatasetConfiguration(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.Cost.Models.Api20211001.IExportDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportDatasetConfiguration(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportDatasetConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfigurationInternal)this).Column, __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 ExportDatasetConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfigurationInternal)this).Column, __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.Cost.Models.Api20211001.IExportDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include + /// all available columns. + [System.ComponentModel.TypeConverter(typeof(ExportDatasetConfigurationTypeConverter))] + public partial interface IExportDatasetConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..ff82595c0b18 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportDatasetConfigurationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportDatasetConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportDatasetConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportDatasetConfiguration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.cs new file mode 100644 index 000000000000..3ca91646a346 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.cs @@ -0,0 +1,65 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include + /// all available columns. + /// + public partial class ExportDatasetConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfigurationInternal + { + + /// Backing field for property. + private string[] _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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] Column { get => this._column; set => this._column = value; } + + /// Creates an new instance. + public ExportDatasetConfiguration() + { + + } + } + /// The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include + /// all available columns. + public partial interface IExportDatasetConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + + } + /// The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include + /// all available columns. + internal 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; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.json.cs new file mode 100644 index 000000000000..2e94e9301122 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDatasetConfiguration.json.cs @@ -0,0 +1,119 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include + /// all available columns. + /// + public partial class ExportDatasetConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportDatasetConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Column;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportDatasetConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._column) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._column ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("columns",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.PowerShell.cs new file mode 100644 index 000000000000..074b890e96c8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.PowerShell.cs @@ -0,0 +1,208 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The definition of an export. + [System.ComponentModel.TypeConverter(typeof(ExportDefinitionTypeConverter))] + public partial class ExportDefinition + { + + /// + /// 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.Cost.Models.Api20211001.IExportDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportDefinition(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.Cost.Models.Api20211001.IExportDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportDefinition(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportDefinition(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.Cost.Models.Api20211001.IExportDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)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 ExportDefinition(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.Cost.Models.Api20211001.IExportDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("TimePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("DataSetConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal)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.Cost.Models.Api20211001.IExportDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The definition of an export. + [System.ComponentModel.TypeConverter(typeof(ExportDefinitionTypeConverter))] + public partial interface IExportDefinition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.TypeConverter.cs new file mode 100644 index 000000000000..280abc0a063f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportDefinitionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.cs new file mode 100644 index 000000000000..0803323af52f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.cs @@ -0,0 +1,177 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of an export. + public partial class ExportDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)DataSet).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)DataSet).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset _dataSet; + + /// The definition for data in the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDataset()); set => this._dataSet = value; } + + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)DataSet).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)DataSet).Granularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); } + + /// Internal Acessors for DataSet + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal.DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDataset()); set { {_dataSet = value;} } } + + /// Internal Acessors for DataSetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)DataSet).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetInternal)DataSet).Configuration = value; } + + /// Internal Acessors for TimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriod()); set { {_timePeriod = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod _timePeriod; + + /// Has time period for pulling data for the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriod()); set => this._timePeriod = value; } + + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } + + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType _timeframe; + + /// + /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType Timeframe { get => this._timeframe; set => this._timeframe = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType _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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ExportDefinition() + { + + } + } + /// The definition of an export. + public partial interface IExportDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get; set; } + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date for export data.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for export data.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodTo { 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.Cost.Runtime.Info( + Required = true, + 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.Cost.Support.TimeframeType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType 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.Cost.Runtime.Info( + Required = true, + 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.Cost.Support.ExportType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType Type { get; set; } + + } + /// The definition of an export. + internal 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; } + /// The definition for data in the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset DataSet { get; set; } + /// The export dataset configuration. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get; set; } + /// Has time period for pulling data for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod TimePeriod { get; set; } + /// The start date for export data. + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + global::System.DateTime? TimePeriodTo { 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.Cost.Support.TimeframeType 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.Cost.Support.ExportType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.json.cs new file mode 100644 index 000000000000..db5e653fa1ac --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDefinition.json.cs @@ -0,0 +1,114 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of an export. + public partial class ExportDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportDefinition(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} + {_dataSet = If( json?.PropertyT("dataSet"), out var __jsonDataSet) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportDefinition(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._timePeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._timePeriod.ToJson(null,serializationMode) : null, "timePeriod" ,container.Add ); + AddIf( null != this._dataSet ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._dataSet.ToJson(null,serializationMode) : null, "dataSet" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._timeframe)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._timeframe.ToString()) : null, "timeframe" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.PowerShell.cs new file mode 100644 index 000000000000..e66cd3f30139 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.PowerShell.cs @@ -0,0 +1,198 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// 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 + /// requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider + /// in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration + /// is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services + /// ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who + /// are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, + /// can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage + /// account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types + /// and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key + /// ). + /// + [System.ComponentModel.TypeConverter(typeof(ExportDeliveryDestinationTypeConverter))] + public partial class ExportDeliveryDestination + { + + /// + /// 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.Cost.Models.Api20211001.IExportDeliveryDestination DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportDeliveryDestination(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.Cost.Models.Api20211001.IExportDeliveryDestination DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportDeliveryDestination(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportDeliveryDestination(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("Container")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).Container = (string) content.GetValueForProperty("Container",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).Container, global::System.Convert.ToString); + } + if (content.Contains("RootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).RootFolderPath = (string) content.GetValueForProperty("RootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).RootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("SasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).SasToken = (string) content.GetValueForProperty("SasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).SasToken, global::System.Convert.ToString); + } + if (content.Contains("StorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).StorageAccount = (string) content.GetValueForProperty("StorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).StorageAccount, 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 ExportDeliveryDestination(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("Container")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).Container = (string) content.GetValueForProperty("Container",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).Container, global::System.Convert.ToString); + } + if (content.Contains("RootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).RootFolderPath = (string) content.GetValueForProperty("RootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).RootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("SasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).SasToken = (string) content.GetValueForProperty("SasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).SasToken, global::System.Convert.ToString); + } + if (content.Contains("StorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).StorageAccount = (string) content.GetValueForProperty("StorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)this).StorageAccount, 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.Cost.Models.Api20211001.IExportDeliveryDestination FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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 + /// requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider + /// in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration + /// is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services + /// ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who + /// are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, + /// can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage + /// account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types + /// and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key + /// ). + [System.ComponentModel.TypeConverter(typeof(ExportDeliveryDestinationTypeConverter))] + public partial interface IExportDeliveryDestination + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.TypeConverter.cs new file mode 100644 index 000000000000..c48996535b30 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportDeliveryDestinationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportDeliveryDestination.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportDeliveryDestination.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportDeliveryDestination.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.cs new file mode 100644 index 000000000000..8b87408f9ce6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.cs @@ -0,0 +1,190 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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 + /// requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider + /// in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration + /// is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services + /// ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who + /// are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, + /// can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage + /// account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types + /// and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key + /// ). + /// + public partial class ExportDeliveryDestination : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal + { + + /// Backing field for property. + private string _container; + + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Container { get => this._container; set => this._container = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _rootFolderPath; + + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string RootFolderPath { get => this._rootFolderPath; set => this._rootFolderPath = value; } + + /// Backing field for property. + private string _sasToken; + + /// + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string SasToken { get => this._sasToken; set => this._sasToken = value; } + + /// Backing field for property. + private string _storageAccount; + + /// + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string StorageAccount { get => this._storageAccount; set => this._storageAccount = value; } + + /// Creates an new instance. + public ExportDeliveryDestination() + { + + } + } + /// 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 + /// requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider + /// in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration + /// is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services + /// ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who + /// are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, + /// can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage + /// account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types + /// and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key + /// ). + public partial interface IExportDeliveryDestination : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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) })] + string Container { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string ResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the directory where exports will be uploaded.", + SerializedName = @"rootFolderPath", + PossibleTypes = new [] { typeof(string) })] + string RootFolderPath { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string SasToken { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string StorageAccount { get; set; } + + } + /// 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 + /// requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider + /// in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration + /// is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services + /// ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who + /// are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, + /// can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage + /// account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types + /// and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key + /// ). + internal partial interface IExportDeliveryDestinationInternal + + { + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + string Container { get; set; } + /// + /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount + /// are specified. + /// + string ResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + string RootFolderPath { get; set; } + /// + /// 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. + /// + string SasToken { get; set; } + /// + /// 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. + /// + string StorageAccount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.json.cs new file mode 100644 index 000000000000..81807a894206 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryDestination.json.cs @@ -0,0 +1,128 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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 + /// requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider + /// in order to give Cost Management services access to the storage. When creating an export in the Azure portal this registration + /// is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services + /// ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who + /// are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, + /// can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage + /// account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types + /// and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key + /// ). + /// + public partial class ExportDeliveryDestination + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportDeliveryDestination(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportDeliveryDestination(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._container)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._container.ToString()) : null, "container" ,container.Add ); + AddIf( null != (((object)this._rootFolderPath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._rootFolderPath.ToString()) : null, "rootFolderPath" ,container.Add ); + AddIf( null != (((object)this._sasToken)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._sasToken.ToString()) : null, "sasToken" ,container.Add ); + AddIf( null != (((object)this._storageAccount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._storageAccount.ToString()) : null, "storageAccount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.PowerShell.cs new file mode 100644 index 000000000000..571412f66006 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.PowerShell.cs @@ -0,0 +1,184 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The delivery information associated with a export. + [System.ComponentModel.TypeConverter(typeof(ExportDeliveryInfoTypeConverter))] + public partial class ExportDeliveryInfo + { + + /// + /// 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.Cost.Models.Api20211001.IExportDeliveryInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportDeliveryInfo(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.Cost.Models.Api20211001.IExportDeliveryInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportDeliveryInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportDeliveryInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationStorageAccount, 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 ExportDeliveryInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).Destination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).Destination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal)this).DestinationStorageAccount, 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.Cost.Models.Api20211001.IExportDeliveryInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The delivery information associated with a export. + [System.ComponentModel.TypeConverter(typeof(ExportDeliveryInfoTypeConverter))] + public partial interface IExportDeliveryInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.TypeConverter.cs new file mode 100644 index 000000000000..342fcb68599a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportDeliveryInfoTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportDeliveryInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportDeliveryInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportDeliveryInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.cs new file mode 100644 index 000000000000..226252a71829 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.cs @@ -0,0 +1,155 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The delivery information associated with a export. + public partial class ExportDeliveryInfo : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination _destination; + + /// Has destination for the export being delivered. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).Container; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).ResourceId = value ?? null; } + + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).RootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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 + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).SasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).StorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestinationInternal)Destination).StorageAccount = value ?? null; } + + /// Internal Acessors for Destination + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfoInternal.Destination { get => (this._destination = this._destination ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestination()); set { {_destination = value;} } } + + /// Creates an new instance. + public ExportDeliveryInfo() + { + + } + } + /// The delivery information associated with a export. + public partial interface IExportDeliveryInfo : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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) })] + string DestinationContainer { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the directory where exports will be uploaded.", + SerializedName = @"rootFolderPath", + PossibleTypes = new [] { typeof(string) })] + string DestinationRootFolderPath { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationSasToken { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationStorageAccount { get; set; } + + } + /// The delivery information associated with a export. + internal partial interface IExportDeliveryInfoInternal + + { + /// Has destination for the export being delivered. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination Destination { get; set; } + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + string DestinationContainer { get; set; } + /// + /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount + /// are specified. + /// + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + string DestinationRootFolderPath { get; set; } + /// + /// 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. + /// + string DestinationSasToken { get; set; } + /// + /// 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. + /// + string DestinationStorageAccount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.json.cs new file mode 100644 index 000000000000..c813211299b3 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportDeliveryInfo.json.cs @@ -0,0 +1,108 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The delivery information associated with a export. + public partial class ExportDeliveryInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportDeliveryInfo(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestination.FromJson(__jsonDestination) : Destination;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportDeliveryInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._destination ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._destination.ToJson(null,serializationMode) : null, "destination" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.PowerShell.cs new file mode 100644 index 000000000000..447610c75a29 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.PowerShell.cs @@ -0,0 +1,440 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ExecutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).ExecutionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType?) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).ExecutionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType.CreateFrom); + } + if (content.Contains("RunSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus.CreateFrom); + } + if (content.Contains("SubmittedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).SubmittedBy, global::System.Convert.ToString); + } + if (content.Contains("SubmittedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("RunSettingDeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingRunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingFormat = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingFormat, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("RunSettingPartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RunSettingNextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("ExecutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).ExecutionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType?) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).ExecutionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType.CreateFrom); + } + if (content.Contains("RunSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus.CreateFrom); + } + if (content.Contains("SubmittedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).SubmittedBy, global::System.Convert.ToString); + } + if (content.Contains("SubmittedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("RunSettingDeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingRunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingFormat = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingFormat, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("RunSettingPartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RunSettingNextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.TypeConverter.cs new file mode 100644 index 000000000000..13e94312163a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportExecutionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportExecution.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportExecution.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportExecution.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.cs new file mode 100644 index 000000000000..4e34fe60faeb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.cs @@ -0,0 +1,573 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// An export execution. + public partial class ExportExecution : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ProxyResource(); + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); } + + /// + /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType? DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionTimeframe = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType)""); } + + /// + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType)""); } + + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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 + /// are specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationResourceId = value ?? null; } + + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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 + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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 + /// the latest version or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + + /// The type of the export execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType? ExecutionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ExecutionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ExecutionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType)""); } + + /// The name of the exported file. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string FileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).FileName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).FileName = value ?? null; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Code = value; } + + /// Internal Acessors for DataSetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DataSetConfiguration = value; } + + /// Internal Acessors for DefinitionDataSet + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionDataSet = value; } + + /// Internal Acessors for DefinitionTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DefinitionTimePeriod = value; } + + /// Internal Acessors for DeliveryInfoDestination + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).DeliveryInfoDestination = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Error = value; } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Message = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionProperties()); set { {_property = value;} } } + + /// Internal Acessors for RunHistoryValue + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunHistoryValue = value; } + + /// Internal Acessors for RunSetting + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.RunSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSetting = value; } + + /// Internal Acessors for RunSettingDefinition + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.RunSettingDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingDefinition = value; } + + /// Internal Acessors for RunSettingDeliveryInfo + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.RunSettingDeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingDeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingDeliveryInfo = value; } + + /// Internal Acessors for RunSettingNextRunTimeEstimate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingNextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingNextRunTimeEstimate = value; } + + /// Internal Acessors for RunSettingRunHistory + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionInternal.RunSettingRunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingRunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingRunHistory = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + + /// The time when the export execution finished. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? ProcessingEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ProcessingEndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ProcessingEndTime = value ?? default(global::System.DateTime); } + + /// The time when export was picked up to be executed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? ProcessingStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ProcessingStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).ProcessingStartTime = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties _property; + + /// The properties of the export execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionProperties()); set => this._property = value; } + + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunHistoryValue; } + + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? RunSettingFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingFormat = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType)""); } + + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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. + /// Note: this option is currently available only for modern commerce scopes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public bool? RunSettingPartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingPartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).RunSettingPartitionData = value ?? default(bool); } + + /// The last known status of the export execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus)""); } + + /// + /// The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions + /// it is 'System'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string SubmittedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).SubmittedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).SubmittedBy = value ?? null; } + + /// The time when export was queued to be executed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? SubmittedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).SubmittedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).SubmittedTime = value ?? default(global::System.DateTime); } + + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).TimePeriodFrom = value ?? default(global::System.DateTime); } + + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)Property).TimePeriodTo = value ?? default(global::System.DateTime); } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public ExportExecution() + { + + } + + /// 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.Cost.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + } + /// An export execution. + public partial interface IExportExecution : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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.Cost.Runtime.Info( + Required = false, + 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.Cost.Support.TimeframeType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType? 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.Cost.Runtime.Info( + Required = false, + 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.Cost.Support.ExportType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType? 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationContainer { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the directory where exports will be uploaded.", + SerializedName = @"rootFolderPath", + PossibleTypes = new [] { typeof(string) })] + string DestinationRootFolderPath { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationSasToken { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationStorageAccount { get; set; } + /// The type of the export execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the export execution.", + SerializedName = @"executionType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType? ExecutionType { get; set; } + /// The name of the exported file. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the exported file.", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + string FileName { get; set; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The time when the export execution finished. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the export execution finished.", + SerializedName = @"processingEndTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ProcessingEndTime { get; set; } + /// The time when export was picked up to be executed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when export was picked up to be executed.", + SerializedName = @"processingStartTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ProcessingStartTime { get; set; } + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of export executions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get; } + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? RunSettingFormat { get; set; } + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If the export has an active schedule, provides an estimate of the next execution time.", + SerializedName = @"nextRunTimeEstimate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RunSettingNextRunTimeEstimate { get; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + bool? RunSettingPartitionData { get; set; } + /// The last known status of the export execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The last known status of the export execution.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus? 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'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string SubmittedBy { get; set; } + /// The time when export was queued to be executed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when export was queued to be executed.", + SerializedName = @"submittedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SubmittedTime { get; set; } + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date for export data.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for export data.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodTo { get; set; } + + } + /// An export execution. + internal partial interface IExportExecutionInternal : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal + { + /// Error code. + string Code { 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; } + /// The export dataset configuration. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get; set; } + /// The definition for data in the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset DefinitionDataSet { get; set; } + /// Has time period for pulling data for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Support.TimeframeType? 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.Cost.Support.ExportType? DefinitionType { get; set; } + /// Has destination for the export being delivered. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get; set; } + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + string DestinationContainer { get; set; } + /// + /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount + /// are specified. + /// + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + string DestinationRootFolderPath { get; set; } + /// + /// 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. + /// + string DestinationSasToken { get; set; } + /// + /// 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. + /// + string DestinationStorageAccount { get; set; } + /// The details of any error. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get; set; } + /// The type of the export execution. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType? ExecutionType { get; set; } + /// The name of the exported file. + string FileName { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + /// The time when the export execution finished. + global::System.DateTime? ProcessingEndTime { get; set; } + /// 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.Cost.Models.Api20211001.IExportExecutionProperties Property { get; set; } + /// A list of export executions. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get; set; } + /// The export settings that were in effect for this execution. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties RunSetting { get; set; } + /// Has the definition for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition RunSettingDefinition { get; set; } + /// Has delivery information for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo RunSettingDeliveryInfo { get; set; } + /// The format of the export being delivered. Currently only 'Csv' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? RunSettingFormat { get; set; } + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + global::System.DateTime? RunSettingNextRunTimeEstimate { get; set; } + /// + /// 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. + /// + bool? RunSettingPartitionData { get; set; } + /// If requested, has the most recent execution history for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult RunSettingRunHistory { get; set; } + /// The last known status of the export execution. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus? 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'. + /// + string SubmittedBy { get; set; } + /// The time when export was queued to be executed. + global::System.DateTime? SubmittedTime { get; set; } + /// The start date for export data. + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + global::System.DateTime? TimePeriodTo { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.json.cs new file mode 100644 index 000000000000..a58f02582782 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecution.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// An export execution. + public partial class ExportExecution + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportExecution(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportExecution(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __proxyResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.PowerShell.cs new file mode 100644 index 000000000000..84f59e895e8c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.PowerShell.cs @@ -0,0 +1,144 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Result of listing the execution history of an export. + [System.ComponentModel.TypeConverter(typeof(ExportExecutionListResultTypeConverter))] + public partial class ExportExecutionListResult + { + + /// + /// 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.Cost.Models.Api20211001.IExportExecutionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportExecutionListResult(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.Cost.Models.Api20211001.IExportExecutionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportExecutionListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportExecutionListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExportExecutionListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + 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.Cost.Models.Api20211001.IExportExecutionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing the execution history of an export. + [System.ComponentModel.TypeConverter(typeof(ExportExecutionListResultTypeConverter))] + public partial interface IExportExecutionListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.TypeConverter.cs new file mode 100644 index 000000000000..b644e80c030d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportExecutionListResultTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportExecutionListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportExecutionListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportExecutionListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.cs new file mode 100644 index 000000000000..4a2afd955527 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.cs @@ -0,0 +1,54 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Result of listing the execution history of an export. + public partial class ExportExecutionListResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResultInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] _value; + + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] Value { get => this._value; } + + /// Creates an new instance. + public ExportExecutionListResult() + { + + } + } + /// Result of listing the execution history of an export. + public partial interface IExportExecutionListResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of export executions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] Value { get; } + + } + /// Result of listing the execution history of an export. + internal partial interface IExportExecutionListResultInternal + + { + /// A list of export executions. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.json.cs new file mode 100644 index 000000000000..6cd2e05aed21 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionListResult.json.cs @@ -0,0 +1,119 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Result of listing the execution history of an export. + public partial class ExportExecutionListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportExecutionListResult(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecution) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecution.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportExecutionListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.PowerShell.cs new file mode 100644 index 000000000000..de542ee64dd8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.PowerShell.cs @@ -0,0 +1,400 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ExecutionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType?) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ExecutionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus.CreateFrom); + } + if (content.Contains("SubmittedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedBy, global::System.Convert.ToString); + } + if (content.Contains("SubmittedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("RunSettingDeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingRunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingFormat = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingFormat, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("RunSettingPartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RunSettingNextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSetting = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties) content.GetValueForProperty("RunSetting",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSetting, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("ExecutionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ExecutionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType?) content.GetValueForProperty("ExecutionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ExecutionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType.CreateFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus.CreateFrom); + } + if (content.Contains("SubmittedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedBy = (string) content.GetValueForProperty("SubmittedBy",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedBy, global::System.Convert.ToString); + } + if (content.Contains("SubmittedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).SubmittedTime = (global::System.DateTime?) content.GetValueForProperty("SubmittedTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingStartTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ProcessingEndTime = (global::System.DateTime?) content.GetValueForProperty("ProcessingEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).FileName = (string) content.GetValueForProperty("FileName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).FileName, global::System.Convert.ToString); + } + if (content.Contains("RunSettingDeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("RunSettingDeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("RunSettingDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingDefinition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingRunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingRunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunSettingRunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingRunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("RunSettingFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingFormat = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("RunSettingFormat",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingFormat, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("RunSettingPartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingPartitionData = (bool?) content.GetValueForProperty("RunSettingPartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingPartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RunSettingNextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunSettingNextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("RunSettingNextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportExecutionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.TypeConverter.cs new file mode 100644 index 000000000000..670054307125 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportExecutionPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportExecutionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportExecutionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportExecutionProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.cs new file mode 100644 index 000000000000..79a7879b3f9e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.cs @@ -0,0 +1,549 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The properties of the export execution. + public partial class ExportExecutionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); } + + /// + /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType? DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionTimeframe = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType)""); } + + /// + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType? DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType)""); } + + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationResourceId = value ?? null; } + + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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 + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DestinationStorageAccount = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails _error; + + /// The details of any error. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set => this._error = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType? _executionType; + + /// The type of the export execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType? ExecutionType { get => this._executionType; set => this._executionType = value; } + + /// Backing field for property. + private string _fileName; + + /// The name of the exported file. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string FileName { get => this._fileName; set => this._fileName = value; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + + /// Internal Acessors for DataSetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DataSetConfiguration = value; } + + /// Internal Acessors for DefinitionDataSet + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionDataSet = value; } + + /// Internal Acessors for DefinitionTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DefinitionTimePeriod = value; } + + /// Internal Acessors for DeliveryInfoDestination + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DeliveryInfoDestination = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + + /// Internal Acessors for RunHistoryValue + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistoryValue = value; } + + /// Internal Acessors for RunSetting + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.RunSetting { get => (this._runSetting = this._runSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportProperties()); set { {_runSetting = value;} } } + + /// Internal Acessors for RunSettingDefinition + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.RunSettingDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).Definition = value; } + + /// Internal Acessors for RunSettingDeliveryInfo + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.RunSettingDeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).DeliveryInfo = value; } + + /// Internal Acessors for RunSettingNextRunTimeEstimate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).NextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).NextRunTimeEstimate = value; } + + /// Internal Acessors for RunSettingRunHistory + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionPropertiesInternal.RunSettingRunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistory = value; } + + /// Backing field for property. + private global::System.DateTime? _processingEndTime; + + /// The time when the export execution finished. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? ProcessingEndTime { get => this._processingEndTime; set => this._processingEndTime = value; } + + /// Backing field for property. + private global::System.DateTime? _processingStartTime; + + /// The time when export was picked up to be executed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? ProcessingStartTime { get => this._processingStartTime; set => this._processingStartTime = value; } + + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).RunHistoryValue; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties _runSetting; + + /// The export settings that were in effect for this execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties RunSetting { get => (this._runSetting = this._runSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportProperties()); set => this._runSetting = value; } + + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? RunSettingFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).Format = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType)""); } + + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? RunSettingNextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public bool? RunSettingPartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).PartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).PartitionData = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus? _status; + + /// The last known status of the export execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus? Status { get => this._status; set => this._status = value; } + + /// Backing field for property. + private string _submittedBy; + + /// + /// The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions + /// it is 'System'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string SubmittedBy { get => this._submittedBy; set => this._submittedBy = value; } + + /// Backing field for property. + private global::System.DateTime? _submittedTime; + + /// The time when export was queued to be executed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? SubmittedTime { get => this._submittedTime; set => this._submittedTime = value; } + + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).TimePeriodFrom = value ?? default(global::System.DateTime); } + + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)RunSetting).TimePeriodTo = value ?? default(global::System.DateTime); } + + /// Creates an new instance. + public ExportExecutionProperties() + { + + } + } + /// The properties of the export execution. + public partial interface IExportExecutionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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.Cost.Runtime.Info( + Required = false, + 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.Cost.Support.TimeframeType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType? 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.Cost.Runtime.Info( + Required = false, + 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.Cost.Support.ExportType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType? 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationContainer { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the directory where exports will be uploaded.", + SerializedName = @"rootFolderPath", + PossibleTypes = new [] { typeof(string) })] + string DestinationRootFolderPath { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationSasToken { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string DestinationStorageAccount { get; set; } + /// The type of the export execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the export execution.", + SerializedName = @"executionType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType? ExecutionType { get; set; } + /// The name of the exported file. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the exported file.", + SerializedName = @"fileName", + PossibleTypes = new [] { typeof(string) })] + string FileName { get; set; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The time when the export execution finished. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when the export execution finished.", + SerializedName = @"processingEndTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ProcessingEndTime { get; set; } + /// The time when export was picked up to be executed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when export was picked up to be executed.", + SerializedName = @"processingStartTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ProcessingStartTime { get; set; } + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A list of export executions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get; } + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? RunSettingFormat { get; set; } + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If the export has an active schedule, provides an estimate of the next execution time.", + SerializedName = @"nextRunTimeEstimate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RunSettingNextRunTimeEstimate { get; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + bool? RunSettingPartitionData { get; set; } + /// The last known status of the export execution. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The last known status of the export execution.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus? 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'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string SubmittedBy { get; set; } + /// The time when export was queued to be executed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time when export was queued to be executed.", + SerializedName = @"submittedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SubmittedTime { get; set; } + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date for export data.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for export data.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodTo { get; set; } + + } + /// The properties of the export execution. + internal partial interface IExportExecutionPropertiesInternal + + { + /// Error code. + string Code { 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; } + /// The export dataset configuration. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get; set; } + /// The granularity of rows in the export. Currently only 'Daily' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get; set; } + /// The definition for data in the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset DefinitionDataSet { get; set; } + /// Has time period for pulling data for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Support.TimeframeType? 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.Cost.Support.ExportType? DefinitionType { get; set; } + /// Has destination for the export being delivered. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get; set; } + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + string DestinationContainer { get; set; } + /// + /// The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount + /// are specified. + /// + string DestinationResourceId { get; set; } + /// The name of the directory where exports will be uploaded. + string DestinationRootFolderPath { get; set; } + /// + /// 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. + /// + string DestinationSasToken { get; set; } + /// + /// 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. + /// + string DestinationStorageAccount { get; set; } + /// The details of any error. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get; set; } + /// The type of the export execution. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType? ExecutionType { get; set; } + /// The name of the exported file. + string FileName { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + /// The time when the export execution finished. + global::System.DateTime? ProcessingEndTime { get; set; } + /// 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.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get; set; } + /// The export settings that were in effect for this execution. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties RunSetting { get; set; } + /// Has the definition for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition RunSettingDefinition { get; set; } + /// Has delivery information for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo RunSettingDeliveryInfo { get; set; } + /// The format of the export being delivered. Currently only 'Csv' is supported. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? RunSettingFormat { get; set; } + /// + /// If the export has an active schedule, provides an estimate of the next execution time. + /// + global::System.DateTime? RunSettingNextRunTimeEstimate { get; set; } + /// + /// 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. + /// + bool? RunSettingPartitionData { get; set; } + /// If requested, has the most recent execution history for the export. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult RunSettingRunHistory { get; set; } + /// The last known status of the export execution. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus? 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'. + /// + string SubmittedBy { get; set; } + /// The time when export was queued to be executed. + global::System.DateTime? SubmittedTime { get; set; } + /// The start date for export data. + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date for export data. + global::System.DateTime? TimePeriodTo { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.json.cs new file mode 100644 index 000000000000..a77ba14151c6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportExecutionProperties.json.cs @@ -0,0 +1,124 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The properties of the export execution. + public partial class ExportExecutionProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportExecutionProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_runSetting = If( json?.PropertyT("runSettings"), out var __jsonRunSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportProperties.FromJson(__jsonRunSettings) : RunSetting;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportExecutionProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._runSetting ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._runSetting.ToJson(null,serializationMode) : null, "runSettings" ,container.Add ); + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AddIf( null != (((object)this._executionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._executionType.ToString()) : null, "executionType" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._submittedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._submittedBy.ToString()) : null, "submittedBy" ,container.Add ); + AddIf( null != this._submittedTime ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._submittedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "submittedTime" ,container.Add ); + AddIf( null != this._processingStartTime ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._processingStartTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "processingStartTime" ,container.Add ); + AddIf( null != this._processingEndTime ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._processingEndTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "processingEndTime" ,container.Add ); + AddIf( null != (((object)this._fileName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._fileName.ToString()) : null, "fileName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.PowerShell.cs new file mode 100644 index 000000000000..ecf18ea76e32 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.PowerShell.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// Result of listing exports. It contains a list of available exports in the scope provided. + /// + [System.ComponentModel.TypeConverter(typeof(ExportListResultTypeConverter))] + public partial class ExportListResult + { + + /// + /// 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.Cost.Models.Api20211001.IExportListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportListResult(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.Cost.Models.Api20211001.IExportListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExportListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTypeConverter.ConvertFrom)); + } + 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.Cost.Models.Api20211001.IExportListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of listing exports. It contains a list of available exports in the scope provided. + [System.ComponentModel.TypeConverter(typeof(ExportListResultTypeConverter))] + public partial interface IExportListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.TypeConverter.cs new file mode 100644 index 000000000000..4803ebc41b12 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportListResultTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.cs new file mode 100644 index 000000000000..6314683f7ba9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.cs @@ -0,0 +1,56 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Result of listing exports. It contains a list of available exports in the scope provided. + /// + public partial class ExportListResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResult, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResultInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport[] _value; + + /// The list of exports. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport[] Value { get => this._value; } + + /// Creates an new instance. + public ExportListResult() + { + + } + } + /// Result of listing exports. It contains a list of available exports in the scope provided. + public partial interface IExportListResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The list of exports. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of exports.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport[] Value { get; } + + } + /// Result of listing exports. It contains a list of available exports in the scope provided. + internal partial interface IExportListResultInternal + + { + /// The list of exports. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.json.cs new file mode 100644 index 000000000000..a0ecf92c5b3e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportListResult.json.cs @@ -0,0 +1,121 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Result of listing exports. It contains a list of available exports in the scope provided. + /// + public partial class ExportListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportListResult(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExport) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Export.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.PowerShell.cs new file mode 100644 index 000000000000..ed24a63a786b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.PowerShell.cs @@ -0,0 +1,360 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IExportPropertiesInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleStatus = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType?) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleStatus, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType.CreateFrom); + } + if (content.Contains("ScheduleRecurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrence = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType?) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrence, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType.CreateFrom); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportPropertiesInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryInfoDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination) content.GetValueForProperty("DeliveryInfoDestination",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfoDestination, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryDestinationTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod) content.GetValueForProperty("DefinitionTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionDataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset) content.GetValueForProperty("DefinitionDataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionDataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("DefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("DefinitionTimeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("DefinitionTimeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DefinitionTimeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("RunHistoryValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[]) content.GetValueForProperty("RunHistoryValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistoryValue, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionTypeConverter.ConvertFrom)); + } + if (content.Contains("DestinationResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId = (string) content.GetValueForProperty("DestinationResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationResourceId, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationRootFolderPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath = (string) content.GetValueForProperty("DestinationRootFolderPath",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationRootFolderPath, global::System.Convert.ToString); + } + if (content.Contains("DestinationSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken = (string) content.GetValueForProperty("DestinationSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationSasToken, global::System.Convert.ToString); + } + if (content.Contains("DestinationStorageAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount = (string) content.GetValueForProperty("DestinationStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DestinationStorageAccount, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeliveryInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo) content.GetValueForProperty("DeliveryInfo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).DeliveryInfo, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDeliveryInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RunHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult) content.GetValueForProperty("RunHistory",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).RunHistory, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportExecutionListResultTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType?) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType.CreateFrom); + } + if (content.Contains("PartitionData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData = (bool?) content.GetValueForProperty("PartitionData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).PartitionData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NextRunTimeEstimate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)this).NextRunTimeEstimate = (global::System.DateTime?) content.GetValueForProperty("NextRunTimeEstimate",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("ScheduleRecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleStatus = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType?) content.GetValueForProperty("ScheduleStatus",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleStatus, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType.CreateFrom); + } + if (content.Contains("ScheduleRecurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrence = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType?) content.GetValueForProperty("ScheduleRecurrence",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).ScheduleRecurrence, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType.CreateFrom); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportPropertiesInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.TypeConverter.cs new file mode 100644 index 000000000000..456105c6f94e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.cs new file mode 100644 index 000000000000..c00cbf1c8ca6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.cs @@ -0,0 +1,255 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The properties of the export. + public partial class ExportProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties __commonExportProperties = new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// The export dataset configuration. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDatasetConfiguration DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DataSetConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DataSetGranularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DataSetGranularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); } + + /// Has the definition for the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDefinition Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).Definition = value ; } + + /// The definition for data in the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDataset DefinitionDataSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionDataSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionDataSet = value ?? null /* model class */; } + + /// Has time period for pulling data for the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod DefinitionTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType DefinitionTimeframe { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionTimeframe; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType DefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DefinitionType = value ; } + + /// Has delivery information for the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryInfo DeliveryInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfo = value ; } + + /// Has destination for the export being delivered. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportDeliveryDestination DeliveryInfoDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DeliveryInfoDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string DestinationContainer { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationContainer; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string DestinationResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationResourceId = value ?? null; } + + /// The name of the directory where exports will be uploaded. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string DestinationRootFolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationRootFolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string DestinationSasToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationSasToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string DestinationStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).DestinationStorageAccount = value ?? null; } + + /// The format of the export being delivered. Currently only 'Csv' is supported. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType? Format { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).Format = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType)""); } + + /// Internal Acessors for NextRunTimeEstimate + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).NextRunTimeEstimate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).NextRunTimeEstimate = value; } + + /// Internal Acessors for RunHistoryValue + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal.RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistoryValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistoryValue = value; } + + /// Internal Acessors for Schedule + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal.Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportSchedule()); set { {_schedule = value;} } } + + /// Internal Acessors for ScheduleRecurrencePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportPropertiesInternal.ScheduleRecurrencePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public global::System.DateTime? NextRunTimeEstimate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public bool? PartitionData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).PartitionData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).PartitionData = value ?? default(bool); } + + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? RecurrencePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriodFrom = value ?? default(global::System.DateTime); } + + /// The end date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? RecurrencePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)Schedule).RecurrencePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecutionListResult RunHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistory = value ?? null /* model class */; } + + /// A list of export executions. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution[] RunHistoryValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).RunHistoryValue; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule _schedule; + + /// Has schedule information for the export. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportSchedule()); set => this._schedule = value; } + + /// The schedule recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType? ScheduleRecurrence { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)Schedule).Recurrence; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)Schedule).Recurrence = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType)""); } + + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType? ScheduleStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)Schedule).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)Schedule).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType)""); } + + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodFrom; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodFrom = value ?? default(global::System.DateTime); } + + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportPropertiesInternal)__commonExportProperties).TimePeriodTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ICommonExportProperties + { + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The schedule recurrence.", + SerializedName = @"recurrence", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType? ScheduleRecurrence { get; set; } + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.StatusType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType? ScheduleStatus { get; set; } + + } + /// The properties of the export. + internal partial interface IExportPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IExportSchedule Schedule { get; set; } + /// The schedule recurrence. + Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Support.StatusType? ScheduleStatus { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.json.cs new file mode 100644 index 000000000000..4efe04459fdb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportProperties.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The properties of the export. + public partial class ExportProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __commonExportProperties = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.CommonExportProperties(json); + {_schedule = If( json?.PropertyT("schedule"), out var __jsonSchedule) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportSchedule.FromJson(__jsonSchedule) : Schedule;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __commonExportProperties?.ToJson(container, serializationMode); + AddIf( null != this._schedule ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._schedule.ToJson(null,serializationMode) : null, "schedule" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.PowerShell.cs new file mode 100644 index 000000000000..f4dab9c29b00 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The start and end date for recurrence schedule. + [System.ComponentModel.TypeConverter(typeof(ExportRecurrencePeriodTypeConverter))] + public partial class ExportRecurrencePeriod + { + + /// + /// 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.Cost.Models.Api20211001.IExportRecurrencePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportRecurrencePeriod(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.Cost.Models.Api20211001.IExportRecurrencePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportRecurrencePeriod(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportRecurrencePeriod(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriodInternal)this).To = (global::System.DateTime?) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExportRecurrencePeriod(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriodInternal)this).To = (global::System.DateTime?) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + 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.Cost.Models.Api20211001.IExportRecurrencePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The start and end date for recurrence schedule. + [System.ComponentModel.TypeConverter(typeof(ExportRecurrencePeriodTypeConverter))] + public partial interface IExportRecurrencePeriod + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.TypeConverter.cs new file mode 100644 index 000000000000..f2ac055d670b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportRecurrencePeriodTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportRecurrencePeriod.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportRecurrencePeriod.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportRecurrencePeriod.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.cs new file mode 100644 index 000000000000..f196cb349705 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The start and end date for recurrence schedule. + public partial class ExportRecurrencePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriodInternal + { + + /// Backing field for property. + private global::System.DateTime _from; + + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime From { get => this._from; set => this._from = value; } + + /// Backing field for property. + private global::System.DateTime? _to; + + /// The end date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? To { get => this._to; set => this._to = value; } + + /// Creates an new instance. + public ExportRecurrencePeriod() + { + + } + } + /// The start and end date for recurrence schedule. + public partial interface IExportRecurrencePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date of recurrence.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime From { get; set; } + /// The end date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date of recurrence.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? To { get; set; } + + } + /// The start and end date for recurrence schedule. + internal partial interface IExportRecurrencePeriodInternal + + { + /// The start date of recurrence. + global::System.DateTime From { get; set; } + /// The end date of recurrence. + global::System.DateTime? To { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.json.cs new file mode 100644 index 000000000000..273b90ccc841 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportRecurrencePeriod.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The start and end date for recurrence schedule. + public partial class ExportRecurrencePeriod + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportRecurrencePeriod(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportRecurrencePeriod(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._from.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "from" ,container.Add ); + AddIf( null != this._to ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._to?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "to" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.PowerShell.cs new file mode 100644 index 000000000000..eebc79b977f1 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.PowerShell.cs @@ -0,0 +1,176 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The schedule associated with the export. + [System.ComponentModel.TypeConverter(typeof(ExportScheduleTypeConverter))] + public partial class ExportSchedule + { + + /// + /// 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.Cost.Models.Api20211001.IExportSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportSchedule(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.Cost.Models.Api20211001.IExportSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportSchedule(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportSchedule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecurrencePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("RecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType.CreateFrom); + } + if (content.Contains("Recurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).Recurrence = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType?) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).Recurrence, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType.CreateFrom); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("RecurrencePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExportSchedule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecurrencePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod) content.GetValueForProperty("RecurrencePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType.CreateFrom); + } + if (content.Contains("Recurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).Recurrence = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType?) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).Recurrence, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType.CreateFrom); + } + if (content.Contains("RecurrencePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodFrom = (global::System.DateTime) content.GetValueForProperty("RecurrencePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("RecurrencePeriodTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal)this).RecurrencePeriodTo = (global::System.DateTime?) content.GetValueForProperty("RecurrencePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + 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.Cost.Models.Api20211001.IExportSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The schedule associated with the export. + [System.ComponentModel.TypeConverter(typeof(ExportScheduleTypeConverter))] + public partial interface IExportSchedule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.TypeConverter.cs new file mode 100644 index 000000000000..ea60b003c187 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportScheduleTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportSchedule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportSchedule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportSchedule.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.cs new file mode 100644 index 000000000000..a36347490d46 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.cs @@ -0,0 +1,120 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The schedule associated with the export. + public partial class ExportSchedule : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal + { + + /// Internal Acessors for RecurrencePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportScheduleInternal.RecurrencePeriod { get => (this._recurrencePeriod = this._recurrencePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriod()); set { {_recurrencePeriod = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType? _recurrence; + + /// The schedule recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType? Recurrence { get => this._recurrence; set => this._recurrence = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriod RecurrencePeriod { get => (this._recurrencePeriod = this._recurrencePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ExportRecurrencePeriod()); set => this._recurrencePeriod = value; } + + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? RecurrencePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriodInternal)RecurrencePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriodInternal)RecurrencePeriod).From = value ?? default(global::System.DateTime); } + + /// The end date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? RecurrencePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriodInternal)RecurrencePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportRecurrencePeriodInternal)RecurrencePeriod).To = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType? _status; + + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public ExportSchedule() + { + + } + } + /// The schedule associated with the export. + public partial interface IExportSchedule : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The schedule recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The schedule recurrence.", + SerializedName = @"recurrence", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType? Recurrence { get; set; } + /// The start date of recurrence. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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 status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.StatusType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType? Status { get; set; } + + } + /// The schedule associated with the export. + internal partial interface IExportScheduleInternal + + { + /// The schedule recurrence. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType? 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.Cost.Models.Api20211001.IExportRecurrencePeriod RecurrencePeriod { get; set; } + /// The start date of recurrence. + global::System.DateTime? RecurrencePeriodFrom { get; set; } + /// The end date of recurrence. + global::System.DateTime? RecurrencePeriodTo { get; set; } + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.json.cs new file mode 100644 index 000000000000..4daeed8a185a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportSchedule.json.cs @@ -0,0 +1,112 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The schedule associated with the export. + public partial class ExportSchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportSchedule(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_recurrencePeriod = If( json?.PropertyT("recurrencePeriod"), out var __jsonRecurrencePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportSchedule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._recurrencePeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._recurrencePeriod.ToJson(null,serializationMode) : null, "recurrencePeriod" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._recurrence)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._recurrence.ToString()) : null, "recurrence" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.PowerShell.cs new file mode 100644 index 000000000000..34fd73d8d9fd --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.PowerShell.cs @@ -0,0 +1,156 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(ExportTimePeriodTypeConverter))] + public partial class ExportTimePeriod + { + + /// + /// 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.Cost.Models.Api20211001.IExportTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExportTimePeriod(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.Cost.Models.Api20211001.IExportTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExportTimePeriod(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExportTimePeriod(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExportTimePeriod(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + 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.Cost.Models.Api20211001.IExportTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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. + [System.ComponentModel.TypeConverter(typeof(ExportTimePeriodTypeConverter))] + public partial interface IExportTimePeriod + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.TypeConverter.cs new file mode 100644 index 000000000000..b074e42c7e8d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExportTimePeriodTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExportTimePeriod.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExportTimePeriod.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExportTimePeriod.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.cs new file mode 100644 index 000000000000..a9cce250db5f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.cs @@ -0,0 +1,73 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class ExportTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriodInternal + { + + /// Backing field for property. + private global::System.DateTime _from; + + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime From { get => this._from; set => this._from = value; } + + /// Backing field for property. + private global::System.DateTime _to; + + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime To { get => this._to; set => this._to = value; } + + /// Creates an new instance. + public ExportTimePeriod() + { + + } + } + /// 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. + public partial interface IExportTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The start date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date for export data.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime From { get; set; } + /// The end date for export data. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The end date for export data.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime To { get; set; } + + } + /// 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. + internal partial interface IExportTimePeriodInternal + + { + /// The start date for export data. + global::System.DateTime From { get; set; } + /// The end date for export data. + global::System.DateTime To { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.json.cs new file mode 100644 index 000000000000..cb16cb393e1f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ExportTimePeriod.json.cs @@ -0,0 +1,113 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class ExportTimePeriod + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ExportTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ExportTimePeriod(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._from.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "from" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._to.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "to" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.PowerShell.cs new file mode 100644 index 000000000000..e97e6d9d9887 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The aggregation expression to be used in the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastAggregationTypeConverter))] + public partial class ForecastAggregation + { + + /// + /// 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.Cost.Models.Api20211001.IForecastAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastAggregation(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.Cost.Models.Api20211001.IForecastAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastAggregation(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastAggregation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName.CreateFrom); + } + if (content.Contains("Function")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal)this).Function, 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 ForecastAggregation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName.CreateFrom); + } + if (content.Contains("Function")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal)this).Function, 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.Cost.Models.Api20211001.IForecastAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The aggregation expression to be used in the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastAggregationTypeConverter))] + public partial interface IForecastAggregation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.TypeConverter.cs new file mode 100644 index 000000000000..65600fb21b3b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastAggregationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastAggregation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastAggregation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastAggregation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.cs new file mode 100644 index 000000000000..bde4f4358373 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.cs @@ -0,0 +1,71 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The aggregation expression to be used in the forecast. + public partial class ForecastAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregation, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal + { + + /// Backing field for property. + private string _function= @"Sum"; + + /// The name of the aggregation function to use. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Function { get => this._function; } + + /// Internal Acessors for Function + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregationInternal.Function { get => this._function; set { {_function = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName _name; + + /// The name of the column to aggregate. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ForecastAggregation() + { + + } + } + /// The aggregation expression to be used in the forecast. + public partial interface IForecastAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The name of the aggregation function to use. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The name of the aggregation function to use.", + SerializedName = @"function", + PossibleTypes = new [] { typeof(string) })] + string Function { get; } + /// The name of the column to aggregate. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the column to aggregate.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName Name { get; set; } + + } + /// The aggregation expression to be used in the forecast. + internal 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.Cost.Support.FunctionName Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.json.cs new file mode 100644 index 000000000000..7c1ee255f0ef --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastAggregation.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The aggregation expression to be used in the forecast. + public partial class ForecastAggregation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastAggregation(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastAggregation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._function)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._function.ToString()) : null, "function" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.PowerShell.cs new file mode 100644 index 000000000000..833b522f232b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Forecast column properties + [System.ComponentModel.TypeConverter(typeof(ForecastColumnTypeConverter))] + public partial class ForecastColumn + { + + /// + /// 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.Cost.Models.Api20211001.IForecastColumn DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastColumn(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.Cost.Models.Api20211001.IForecastColumn DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastColumn(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastColumn(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumnInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumnInternal)this).Type, 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 ForecastColumn(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumnInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumnInternal)this).Type, 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.Cost.Models.Api20211001.IForecastColumn FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Forecast column properties + [System.ComponentModel.TypeConverter(typeof(ForecastColumnTypeConverter))] + public partial interface IForecastColumn + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.TypeConverter.cs new file mode 100644 index 000000000000..82aea9813ada --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastColumnTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastColumn.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastColumn.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastColumn.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.cs new file mode 100644 index 000000000000..4c254b5fe3cc --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Forecast column properties + public partial class ForecastColumn : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumnInternal + { + + /// Backing field for property. + private string _name; + + /// The name of column. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _type; + + /// The type of column. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ForecastColumn() + { + + } + } + /// Forecast column properties + public partial interface IForecastColumn : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The name of column. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of column.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The type of column. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of column.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// Forecast column properties + internal partial interface IForecastColumnInternal + + { + /// The name of column. + string Name { get; set; } + /// The type of column. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.json.cs new file mode 100644 index 000000000000..c7b23188a343 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastColumn.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Forecast column properties + public partial class ForecastColumn + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastColumn(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastColumn(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.PowerShell.cs new file mode 100644 index 000000000000..0d03515eedfe --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.PowerShell.cs @@ -0,0 +1,160 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The comparison expression to be used in the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastComparisonExpressionTypeConverter))] + public partial class ForecastComparisonExpression + { + + /// + /// 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.Cost.Models.Api20211001.IForecastComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastComparisonExpression(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.Cost.Models.Api20211001.IForecastComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastComparisonExpression(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastComparisonExpression(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Value, __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 ForecastComparisonExpression(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)this).Value, __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.Cost.Models.Api20211001.IForecastComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The comparison expression to be used in the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastComparisonExpressionTypeConverter))] + public partial interface IForecastComparisonExpression + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.TypeConverter.cs new file mode 100644 index 000000000000..ab5e50af663a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastComparisonExpressionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastComparisonExpression.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastComparisonExpression.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastComparisonExpression.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.cs new file mode 100644 index 000000000000..af22db4fec7e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.cs @@ -0,0 +1,88 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The comparison expression to be used in the forecast. + public partial class ForecastComparisonExpression : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal + { + + /// Internal Acessors for Operator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal.Operator { get => this._operator; set { {_operator = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _operator= @"In"; + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Operator { get => this._operator; } + + /// Backing field for property. + private string[] _value; + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ForecastComparisonExpression() + { + + } + } + /// The comparison expression to be used in the forecast. + public partial interface IForecastComparisonExpression : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string Operator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// The comparison expression to be used in the forecast. + internal partial interface IForecastComparisonExpressionInternal + + { + /// The name of the column to use in comparison. + string Name { get; set; } + /// The operator to use for comparison. + string Operator { get; set; } + /// Array of values to use for comparison + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.json.cs new file mode 100644 index 000000000000..9177aacf85a4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastComparisonExpression.json.cs @@ -0,0 +1,120 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The comparison expression to be used in the forecast. + public partial class ForecastComparisonExpression + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastComparisonExpression(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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.Cost.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.Cost.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastComparisonExpression(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._operator)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._operator.ToString()) : null, "operator" ,container.Add ); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.PowerShell.cs new file mode 100644 index 000000000000..a330ed4da04f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.PowerShell.cs @@ -0,0 +1,256 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IForecastDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("Aggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("Aggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.TypeConverter.cs new file mode 100644 index 000000000000..b2b0db4f0ecd --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastDatasetTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastDataset.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastDataset.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastDataset.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.cs new file mode 100644 index 000000000000..52f1a77eb6ab --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.cs @@ -0,0 +1,258 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of data present in the forecast. + public partial class ForecastDataset : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation Aggregation { get => (this._aggregation = this._aggregation ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetAggregation()); set => this._aggregation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).DimensionName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).DimensionOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).DimensionValue = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter _filter; + + /// Has filter expression to use in the forecast. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilter()); set => this._filter = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).And; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).And = value ?? null /* arrayOf */; } + + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).Or; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).Or = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? _granularity; + + /// The granularity of rows in the forecast. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? Granularity { get => this._granularity; set => this._granularity = value; } + + /// Internal Acessors for Configuration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetConfiguration()); set { {_configuration = value;} } } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).DimensionOperator = value; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilter()); set { {_filter = value;} } } + + /// Internal Acessors for FilterDimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).Dimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).Dimension = value; } + + /// Internal Acessors for FilterTag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).Tag = value; } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).TagOperator = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).TagName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).TagOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)Filter).TagValue = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public ForecastDataset() + { + + } + } + /// The definition of data present in the forecast. + public partial interface IForecastDataset : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Models.Api20211001.IForecastDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DimensionName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string DimensionOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] DimensionValue { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get; set; } + /// The granularity of rows in the forecast. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the forecast.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? Granularity { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string TagOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + + } + /// The definition of data present in the forecast. + internal 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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; } + /// 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; } + /// Has filter expression to use in the forecast. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter Filter { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression FilterDimension { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression FilterTag { get; set; } + /// The granularity of rows in the forecast. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.json.cs new file mode 100644 index 000000000000..d070719acc89 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDataset.json.cs @@ -0,0 +1,114 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of data present in the forecast. + public partial class ForecastDataset + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastDataset(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetConfiguration.FromJson(__jsonConfiguration) : Configuration;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.ForecastDatasetAggregation.FromJson(__jsonAggregation) : Aggregation;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastDataset(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._configuration ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._configuration.ToJson(null,serializationMode) : null, "configuration" ,container.Add ); + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filter" ,container.Add ); + AddIf( null != (((object)this._granularity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._granularity.ToString()) : null, "granularity" ,container.Add ); + AddIf( null != this._aggregation ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._aggregation.ToJson(null,serializationMode) : null, "aggregation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.PowerShell.cs new file mode 100644 index 000000000000..a0ce6163c938 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.PowerShell.cs @@ -0,0 +1,144 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(ForecastDatasetAggregationTypeConverter))] + public partial class ForecastDatasetAggregation + { + + /// + /// 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.Cost.Models.Api20211001.IForecastDatasetAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastDatasetAggregation(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.Cost.Models.Api20211001.IForecastDatasetAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastDatasetAggregation(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastDatasetAggregation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ForecastDatasetAggregation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + 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.Cost.Models.Api20211001.IForecastDatasetAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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. + [System.ComponentModel.TypeConverter(typeof(ForecastDatasetAggregationTypeConverter))] + public partial interface IForecastDatasetAggregation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.TypeConverter.cs new file mode 100644 index 000000000000..184acd68079b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastDatasetAggregationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastDatasetAggregation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastDatasetAggregation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastDatasetAggregation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.cs new file mode 100644 index 000000000000..a18cd42f1b3c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.cs @@ -0,0 +1,40 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class ForecastDatasetAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregationInternal + { + + /// Creates an new instance. + public ForecastDatasetAggregation() + { + + } + } + /// 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. + public partial interface IForecastDatasetAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray + { + + } + /// 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. + internal partial interface IForecastDatasetAggregationInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.dictionary.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.dictionary.cs new file mode 100644 index 000000000000..c606febebadb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.dictionary.cs @@ -0,0 +1,75 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class ForecastDatasetAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregation this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregation value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastAggregation value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetAggregation source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.json.cs new file mode 100644 index 000000000000..a558e12bd4b5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetAggregation.json.cs @@ -0,0 +1,112 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class ForecastDatasetAggregation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ForecastDatasetAggregation(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastAggregation.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastDatasetAggregation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.PowerShell.cs new file mode 100644 index 000000000000..523d1a751ee9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.PowerShell.cs @@ -0,0 +1,144 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The configuration of dataset in the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastDatasetConfigurationTypeConverter))] + public partial class ForecastDatasetConfiguration + { + + /// + /// 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.Cost.Models.Api20211001.IForecastDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastDatasetConfiguration(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.Cost.Models.Api20211001.IForecastDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastDatasetConfiguration(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastDatasetConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfigurationInternal)this).Column, __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 ForecastDatasetConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfigurationInternal)this).Column, __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.Cost.Models.Api20211001.IForecastDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The configuration of dataset in the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastDatasetConfigurationTypeConverter))] + public partial interface IForecastDatasetConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..891eaa36296f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastDatasetConfigurationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastDatasetConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastDatasetConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastDatasetConfiguration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.cs new file mode 100644 index 000000000000..749c1e211c9b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.cs @@ -0,0 +1,60 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The configuration of dataset in the forecast. + public partial class ForecastDatasetConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfigurationInternal + { + + /// Backing field for property. + private string[] _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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] Column { get => this._column; set => this._column = value; } + + /// Creates an new instance. + public ForecastDatasetConfiguration() + { + + } + } + /// The configuration of dataset in the forecast. + public partial interface IForecastDatasetConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + + } + /// The configuration of dataset in the forecast. + internal 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; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.json.cs new file mode 100644 index 000000000000..476675d56448 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDatasetConfiguration.json.cs @@ -0,0 +1,116 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The configuration of dataset in the forecast. + public partial class ForecastDatasetConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastDatasetConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Column;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastDatasetConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._column) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._column ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("columns",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.PowerShell.cs new file mode 100644 index 000000000000..9f0c44e860b7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.PowerShell.cs @@ -0,0 +1,320 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType.CreateFrom); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Timeframe, global::System.Convert.ToString); + } + if (content.Contains("IncludeActualCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).IncludeActualCost = (bool?) content.GetValueForProperty("IncludeActualCost",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).IncludeActualCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeFreshPartialCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).IncludeFreshPartialCost = (bool?) content.GetValueForProperty("IncludeFreshPartialCost",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).IncludeFreshPartialCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("DatasetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType.CreateFrom); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Timeframe = (string) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).Timeframe, global::System.Convert.ToString); + } + if (content.Contains("IncludeActualCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).IncludeActualCost = (bool?) content.GetValueForProperty("IncludeActualCost",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).IncludeActualCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeFreshPartialCost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).IncludeFreshPartialCost = (bool?) content.GetValueForProperty("IncludeFreshPartialCost",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).IncludeFreshPartialCost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("DatasetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.TypeConverter.cs new file mode 100644 index 000000000000..f0496cb8c059 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastDefinitionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.cs new file mode 100644 index 000000000000..aef5a51e836e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a forecast. + public partial class ForecastDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset _dataset; + + /// Has definition for data in this forecast. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation DatasetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).Aggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).Aggregation = value ; } + + /// The granularity of rows in the forecast. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DatasetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).Granularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionValue = value ?? null /* arrayOf */; } + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterAnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterAnd = value ?? null /* arrayOf */; } + + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterOr; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterOr = value ?? null /* arrayOf */; } + + /// Backing field for property. + private bool? _includeActualCost; + + /// A boolean determining if actualCost will be included. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public bool? IncludeActualCost { get => this._includeActualCost; set => this._includeActualCost = value; } + + /// Backing field for property. + private bool? _includeFreshPartialCost; + + /// A boolean determining if FreshPartialCost will be included. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public bool? IncludeFreshPartialCost { get => this._includeFreshPartialCost; set => this._includeFreshPartialCost = value; } + + /// Internal Acessors for Dataset + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDataset Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal.Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDataset()); set { {_dataset = value;} } } + + /// Internal Acessors for DatasetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal.DatasetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).Configuration = value; } + + /// Internal Acessors for DatasetFilter + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal.DatasetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).Filter = value; } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).DimensionOperator = value; } + + /// Internal Acessors for FilterDimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterDimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterDimension = value; } + + /// Internal Acessors for FilterTag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).FilterTag = value; } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).TagOperator = value; } + + /// Internal Acessors for TimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastTimePeriod()); set { {_timePeriod = value;} } } + + /// Internal Acessors for Timeframe + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinitionInternal.Timeframe { get => this._timeframe; set { {_timeframe = value;} } } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).TagName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).TagOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetInternal)Dataset).TagValue = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod _timePeriod; + + /// Has time period for pulling data for the forecast. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastTimePeriod()); set => this._timePeriod = value; } + + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } + + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _timeframe= @"Custom"; + + /// + /// The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Timeframe { get => this._timeframe; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType _type; + + /// The type of the forecast. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ForecastDefinition() + { + + } + } + /// The definition of a forecast. + public partial interface IForecastDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// + /// 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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Models.Api20211001.IForecastDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation DatasetAggregation { get; set; } + /// The granularity of rows in the forecast. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the forecast.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DatasetGranularity { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DimensionName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string DimensionOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] DimensionValue { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get; set; } + /// A boolean determining if actualCost will be included. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if actualCost will be included.", + SerializedName = @"includeActualCost", + PossibleTypes = new [] { typeof(bool) })] + bool? IncludeActualCost { get; set; } + /// A boolean determining if FreshPartialCost will be included. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if FreshPartialCost will be included.", + SerializedName = @"includeFreshPartialCost", + PossibleTypes = new [] { typeof(bool) })] + bool? IncludeFreshPartialCost { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string TagOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodTo { get; set; } + /// + /// The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = 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) })] + string Timeframe { get; } + /// The type of the forecast. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the forecast.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType Type { get; set; } + + } + /// The definition of a forecast. + internal 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; } + /// Has definition for data in this forecast. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IForecastDatasetConfiguration DatasetConfiguration { get; set; } + /// Has filter expression to use in the forecast. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter DatasetFilter { get; set; } + /// The granularity of rows in the forecast. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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; } + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression FilterDimension { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression FilterTag { get; set; } + /// A boolean determining if actualCost will be included. + bool? IncludeActualCost { get; set; } + /// A boolean determining if FreshPartialCost will be included. + bool? IncludeFreshPartialCost { 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; } + /// Has time period for pulling data for the forecast. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod TimePeriod { get; set; } + /// The start date to pull data from. + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date to pull data to. + global::System.DateTime? TimePeriodTo { get; set; } + /// + /// The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. + /// + string Timeframe { get; set; } + /// The type of the forecast. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.json.cs new file mode 100644 index 000000000000..ee5c7ffd51f1 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastDefinition.json.cs @@ -0,0 +1,118 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a forecast. + public partial class ForecastDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastDefinition(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} + {_dataset = If( json?.PropertyT("dataset"), out var __jsonDataset) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastDefinition(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._timePeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._timePeriod.ToJson(null,serializationMode) : null, "timePeriod" ,container.Add ); + AddIf( null != this._dataset ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._dataset.ToJson(null,serializationMode) : null, "dataset" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._timeframe)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._timeframe.ToString()) : null, "timeframe" ,container.Add ); + AddIf( null != this._includeActualCost ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonBoolean((bool)this._includeActualCost) : null, "includeActualCost" ,container.Add ); + AddIf( null != this._includeFreshPartialCost ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonBoolean((bool)this._includeFreshPartialCost) : null, "includeFreshPartialCost" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.PowerShell.cs new file mode 100644 index 000000000000..4ee200cab4e0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.PowerShell.cs @@ -0,0 +1,216 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The filter expression to be used in the export. + [System.ComponentModel.TypeConverter(typeof(ForecastFilterTypeConverter))] + public partial class ForecastFilter + { + + /// + /// 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.Cost.Models.Api20211001.IForecastFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastFilter(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.Cost.Models.Api20211001.IForecastFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastFilter(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("And")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("Or")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)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 ForecastFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("And")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("Or")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal)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.Cost.Models.Api20211001.IForecastFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The filter expression to be used in the export. + [System.ComponentModel.TypeConverter(typeof(ForecastFilterTypeConverter))] + public partial interface IForecastFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.TypeConverter.cs new file mode 100644 index 000000000000..aa9307a68126 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastFilterTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.cs new file mode 100644 index 000000000000..f5ba30b235c9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.cs @@ -0,0 +1,182 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The filter expression to be used in the export. + public partial class ForecastFilter : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] _and; + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] And { get => this._and; set => this._and = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression _dimension; + + /// Has comparison expression for a dimension + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpression()); set => this._dimension = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Operator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Value = value ?? null /* arrayOf */; } + + /// Internal Acessors for Dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal.Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpression()); set { {_dimension = value;} } } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Dimension).Operator = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpression()); set { {_tag = value;} } } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilterInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Operator = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] _or; + + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] Or { get => this._or; set => this._or = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression _tag; + + /// Has comparison expression for a tag + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpression()); set => this._tag = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Operator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastComparisonExpressionInternal)Tag).Value = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public ForecastFilter() + { + + } + } + /// The filter expression to be used in the export. + public partial interface IForecastFilter : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] And { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DimensionName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string DimensionOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] DimensionValue { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] Or { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string TagOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + + } + /// The filter expression to be used in the export. + internal partial interface IForecastFilterInternal + + { + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] And { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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; } + /// The logical "OR" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] Or { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.json.cs new file mode 100644 index 000000000000..5d7b59e93abc --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastFilter.json.cs @@ -0,0 +1,130 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The filter expression to be used in the export. + public partial class ForecastFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastFilter(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpression.FromJson(__jsonDimensions) : Dimension;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastComparisonExpression.FromJson(__jsonTags) : Tag;} + {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastFilter) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilter.FromJson(__u) )) ))() : null : And;} + {_or = If( json?.PropertyT("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IForecastFilter) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastFilter.FromJson(__p) )) ))() : null : Or;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastFilter(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._dimension ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._dimension.ToJson(null,serializationMode) : null, "dimensions" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + if (null != this._and) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._and ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("and",__w); + } + if (null != this._or) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __s in this._or ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("or",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.PowerShell.cs new file mode 100644 index 000000000000..196f72bb7186 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.PowerShell.cs @@ -0,0 +1,160 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Forecast properties + [System.ComponentModel.TypeConverter(typeof(ForecastPropertiesTypeConverter))] + public partial class ForecastProperties + { + + /// + /// 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.Cost.Models.Api20211001.IForecastProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastProperties(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.Cost.Models.Api20211001.IForecastProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastColumnTypeConverter.ConvertFrom)); + } + if (content.Contains("Row")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ForecastProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastColumnTypeConverter.ConvertFrom)); + } + if (content.Contains("Row")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom))); + } + 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.Cost.Models.Api20211001.IForecastProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Forecast properties + [System.ComponentModel.TypeConverter(typeof(ForecastPropertiesTypeConverter))] + public partial interface IForecastProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.TypeConverter.cs new file mode 100644 index 000000000000..ff027aac13eb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.cs new file mode 100644 index 000000000000..e44c97a1591d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.cs @@ -0,0 +1,85 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Forecast properties + public partial class ForecastProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[] _column; + + /// Array of columns + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[] Column { get => this._column; set => this._column = value; } + + /// Backing field for property. + private string _nextLink; + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] _row; + + /// Array of rows + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get => this._row; set => this._row = value; } + + /// Creates an new instance. + public ForecastProperties() + { + + } + } + /// Forecast properties + public partial interface IForecastProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Array of columns + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of columns", + SerializedName = @"columns", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[] Column { get; set; } + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The link (url) to the next page of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Array of rows + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of rows", + SerializedName = @"rows", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get; set; } + + } + /// Forecast properties + internal partial interface IForecastPropertiesInternal + + { + /// Array of columns + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[] Column { get; set; } + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// Array of rows + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.json.cs new file mode 100644 index 000000000000..fb2c7b755059 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastProperties.json.cs @@ -0,0 +1,128 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Forecast properties + public partial class ForecastProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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.Cost.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.Cost.Models.Api20211001.IForecastColumn) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastColumn.FromJson(__u) )) ))() : null : Column;} + {_row = If( json?.PropertyT("rows"), out var __jsonRows) ? If( __jsonRows as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.IAny[]) (If( __o as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.IAny) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Any.FromJson(__m) )) ))() : null /* arrayOf */)) ))() : null : Row;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + if (null != this._column) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._column ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("columns",__w); + } + if (null != this._row) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __s in this._row ) + { + AddIf(null != __s ? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(__s, (__q) => __q?.ToJson(null, serializationMode)))) : null ,__r.Add); + } + container.Add("rows",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.PowerShell.cs new file mode 100644 index 000000000000..9a1b9b6988fa --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.PowerShell.cs @@ -0,0 +1,226 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// Result of forecast. It contains all columns listed under groupings and aggregation. + /// + [System.ComponentModel.TypeConverter(typeof(ForecastResultTypeConverter))] + public partial class ForecastResult + { + + /// + /// 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.Cost.Models.Api20211001.IForecastResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastResult(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.Cost.Models.Api20211001.IForecastResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastResult(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.Cost.Models.Api20211001.IForecastResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastColumnTypeConverter.ConvertFrom)); + } + if (content.Contains("Row")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ForecastResult(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.Cost.Models.Api20211001.IForecastResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastColumnTypeConverter.ConvertFrom)); + } + if (content.Contains("Row")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom))); + } + 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.Cost.Models.Api20211001.IForecastResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of forecast. It contains all columns listed under groupings and aggregation. + [System.ComponentModel.TypeConverter(typeof(ForecastResultTypeConverter))] + public partial interface IForecastResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.TypeConverter.cs new file mode 100644 index 000000000000..a4485c83e40f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastResultTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.cs new file mode 100644 index 000000000000..c7cec2f54f9a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.cs @@ -0,0 +1,157 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Result of forecast. It contains all columns listed under groupings and aggregation. + /// + public partial class ForecastResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Resource(); + + /// Array of columns + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[] Column { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)Property).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)Property).Column = value ?? null /* arrayOf */; } + + /// ETag of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).ETag; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Location; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastProperties()); set { {_property = value;} } } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).ETag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Location = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Sku + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Sku = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)Property).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties _property; + + /// Forecast properties + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastProperties()); set => this._property = value; } + + /// Array of rows + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)Property).Row; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastPropertiesInternal)Property).Row = value ?? null /* arrayOf */; } + + /// SKU of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Sku; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ForecastResult() + { + + } + + /// 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.Cost.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Result of forecast. It contains all columns listed under groupings and aggregation. + public partial interface IForecastResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource + { + /// Array of columns + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of columns", + SerializedName = @"columns", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[] Column { get; set; } + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The link (url) to the next page of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Array of rows + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of rows", + SerializedName = @"rows", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get; set; } + + } + /// Result of forecast. It contains all columns listed under groupings and aggregation. + internal partial interface IForecastResultInternal : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal + { + /// Array of columns + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastColumn[] Column { get; set; } + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// Forecast properties + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastProperties Property { get; set; } + /// Array of rows + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.json.cs new file mode 100644 index 000000000000..c00b0e81cb17 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastResult.json.cs @@ -0,0 +1,112 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Result of forecast. It contains all columns listed under groupings and aggregation. + /// + public partial class ForecastResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastResult(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.PowerShell.cs new file mode 100644 index 000000000000..0d17c6870957 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Has time period for pulling data for the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastTimePeriodTypeConverter))] + public partial class ForecastTimePeriod + { + + /// + /// 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.Cost.Models.Api20211001.IForecastTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ForecastTimePeriod(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.Cost.Models.Api20211001.IForecastTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ForecastTimePeriod(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ForecastTimePeriod(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ForecastTimePeriod(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + 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.Cost.Models.Api20211001.IForecastTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Has time period for pulling data for the forecast. + [System.ComponentModel.TypeConverter(typeof(ForecastTimePeriodTypeConverter))] + public partial interface IForecastTimePeriod + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.TypeConverter.cs new file mode 100644 index 000000000000..e4ab2fb79acb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ForecastTimePeriodTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ForecastTimePeriod.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ForecastTimePeriod.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ForecastTimePeriod.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.cs new file mode 100644 index 000000000000..383d8d39e812 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Has time period for pulling data for the forecast. + public partial class ForecastTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriodInternal + { + + /// Backing field for property. + private global::System.DateTime _from; + + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime From { get => this._from; set => this._from = value; } + + /// Backing field for property. + private global::System.DateTime _to; + + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime To { get => this._to; set => this._to = value; } + + /// Creates an new instance. + public ForecastTimePeriod() + { + + } + } + /// Has time period for pulling data for the forecast. + public partial interface IForecastTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime From { get; set; } + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime To { get; set; } + + } + /// Has time period for pulling data for the forecast. + internal partial interface IForecastTimePeriodInternal + + { + /// The start date to pull data from. + global::System.DateTime From { get; set; } + /// The end date to pull data to. + global::System.DateTime To { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.json.cs new file mode 100644 index 000000000000..0117461815af --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ForecastTimePeriod.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Has time period for pulling data for the forecast. + public partial class ForecastTimePeriod + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ForecastTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ForecastTimePeriod(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._from.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "from" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._to.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "to" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.PowerShell.cs new file mode 100644 index 000000000000..ed13095c1464 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.PowerShell.cs @@ -0,0 +1,196 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The definition of a cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportDefinitionTypeConverter))] + public partial class GenerateDetailedCostReportDefinition + { + + /// + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateDetailedCostReportDefinition(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.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateDetailedCostReportDefinition(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.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateDetailedCostReportDefinition(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.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType.CreateFrom); + } + if (content.Contains("BillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).BillingPeriod = (string) content.GetValueForProperty("BillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).BillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("CustomerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).CustomerId = (string) content.GetValueForProperty("CustomerId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).CustomerId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)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 GenerateDetailedCostReportDefinition(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.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType.CreateFrom); + } + if (content.Contains("BillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).BillingPeriod = (string) content.GetValueForProperty("BillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).BillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("CustomerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).CustomerId = (string) content.GetValueForProperty("CustomerId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).CustomerId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal)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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The definition of a cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportDefinitionTypeConverter))] + public partial interface IGenerateDetailedCostReportDefinition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.TypeConverter.cs new file mode 100644 index 000000000000..2b7acdbf8cb9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateDetailedCostReportDefinitionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateDetailedCostReportDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.cs new file mode 100644 index 000000000000..31976fbcd613 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.cs @@ -0,0 +1,172 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a cost detailed report. + public partial class GenerateDetailedCostReportDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal + { + + /// Backing field for property. + private string _billingPeriod; + + /// + /// Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one + /// of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string BillingPeriod { get => this._billingPeriod; set => this._billingPeriod = value; } + + /// Backing field for property. + private string _customerId; + + /// + /// Customer Id for Modern (Invoice Id and billing profile is also required for this). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string CustomerId { get => this._customerId; set => this._customerId = value; } + + /// Backing field for property. + private string _invoiceId; + + /// + /// Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId + /// or billingPeriod parameters. If none provided current month cost is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string InvoiceId { get => this._invoiceId; set => this._invoiceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType? _metric; + + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType? Metric { get => this._metric; set => this._metric = value; } + + /// Internal Acessors for TimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportTimePeriod()); set { {_timePeriod = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod _timePeriod; + + /// + /// Has time period for pulling data for the cost detailed report. Can only have one of either timePeriod or invoiceId or + /// billingPeriod parameters. If none provided current month cost is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportTimePeriod()); set => this._timePeriod = value; } + + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)TimePeriod).End; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)TimePeriod).End = value ?? null; } + + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)TimePeriod).Start; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)TimePeriod).Start = value ?? null; } + + /// Creates an new instance. + public GenerateDetailedCostReportDefinition() + { + + } + } + /// The definition of a cost detailed report. + public partial interface IGenerateDetailedCostReportDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one + /// of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided.", + SerializedName = @"billingPeriod", + PossibleTypes = new [] { typeof(string) })] + string BillingPeriod { get; set; } + /// + /// Customer Id for Modern (Invoice Id and billing profile is also required for this). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Customer Id for Modern (Invoice Id and billing profile is also required for this).", + SerializedName = @"customerId", + PossibleTypes = new [] { typeof(string) })] + string CustomerId { get; set; } + /// + /// Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId + /// or billingPeriod parameters. If none provided current month cost is provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided.", + SerializedName = @"invoiceId", + PossibleTypes = new [] { typeof(string) })] + string InvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the detailed report. By default ActualCost is provided", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType? Metric { get; set; } + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to. example format 2020-03-15", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodEnd { get; set; } + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from. example format 2020-03-15", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodStart { get; set; } + + } + /// The definition of a cost detailed report. + internal partial interface IGenerateDetailedCostReportDefinitionInternal + + { + /// + /// Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one + /// of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided. + /// + string BillingPeriod { get; set; } + /// + /// Customer Id for Modern (Invoice Id and billing profile is also required for this). + /// + string CustomerId { get; set; } + /// + /// Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId + /// or billingPeriod parameters. If none provided current month cost is provided. + /// + string InvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType? Metric { get; set; } + /// + /// Has time period for pulling data for the cost detailed report. Can only have one of either timePeriod or invoiceId or + /// billingPeriod parameters. If none provided current month cost is provided. + /// + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod 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 + string TimePeriodStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.json.cs new file mode 100644 index 000000000000..58e3892cf5bf --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportDefinition.json.cs @@ -0,0 +1,117 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a cost detailed report. + public partial class GenerateDetailedCostReportDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateDetailedCostReportDefinition(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateDetailedCostReportDefinition(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportTimePeriod.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;} + {_customerId = If( json?.PropertyT("customerId"), out var __jsonCustomerId) ? (string)__jsonCustomerId : (string)CustomerId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._timePeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._timePeriod.ToJson(null,serializationMode) : null, "timePeriod" ,container.Add ); + AddIf( null != (((object)this._metric)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._metric.ToString()) : null, "metric" ,container.Add ); + AddIf( null != (((object)this._billingPeriod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._billingPeriod.ToString()) : null, "billingPeriod" ,container.Add ); + AddIf( null != (((object)this._invoiceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._invoiceId.ToString()) : null, "invoiceId" ,container.Add ); + AddIf( null != (((object)this._customerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._customerId.ToString()) : null, "customerId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..e604cd6fb78d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.PowerShell.cs @@ -0,0 +1,183 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the + /// maximum size permitted of 2Gb. Please utilize our Exports feature instead. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + /// + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportErrorResponseTypeConverter))] + public partial class GenerateDetailedCostReportErrorResponse + { + + /// + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateDetailedCostReportErrorResponse(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.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateDetailedCostReportErrorResponse(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.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateDetailedCostReportErrorResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Message, 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 GenerateDetailedCostReportErrorResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal)this).Message, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the + /// maximum size permitted of 2Gb. Please utilize our Exports feature instead. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportErrorResponseTypeConverter))] + public partial interface IGenerateDetailedCostReportErrorResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..ad42a11d4e32 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.TypeConverter.cs @@ -0,0 +1,151 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateDetailedCostReportErrorResponseTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateDetailedCostReportErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportErrorResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportErrorResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.cs new file mode 100644 index 000000000000..1a3d06407e12 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.cs @@ -0,0 +1,106 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the + /// maximum size permitted of 2Gb. Please utilize our Exports feature instead. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + /// + public partial class GenerateDetailedCostReportErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails _error; + + /// The details of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set => this._error = value; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + + /// Creates an new instance. + public GenerateDetailedCostReportErrorResponse() + { + + } + } + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the + /// maximum size permitted of 2Gb. Please utilize our Exports feature instead. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + public partial interface IGenerateDetailedCostReportErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the + /// maximum size permitted of 2Gb. Please utilize our Exports feature instead. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + internal partial interface IGenerateDetailedCostReportErrorResponseInternal + + { + /// Error code. + string Code { get; set; } + /// The details of the error. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.json.cs new file mode 100644 index 000000000000..f20677b3686c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportErrorResponse.json.cs @@ -0,0 +1,120 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the + /// maximum size permitted of 2Gb. Please utilize our Exports feature instead. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" + /// header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + /// + public partial class GenerateDetailedCostReportErrorResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateDetailedCostReportErrorResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateDetailedCostReportErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.PowerShell.cs new file mode 100644 index 000000000000..fd58b85e8adb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.PowerShell.cs @@ -0,0 +1,189 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The result of the long running operation for cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportOperationResultTypeConverter))] + public partial class GenerateDetailedCostReportOperationResult + { + + /// + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateDetailedCostReportOperationResult(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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateDetailedCostReportOperationResult(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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateDetailedCostReportOperationResult(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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrlTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DownloadUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).DownloadUrl = (string) content.GetValueForProperty("DownloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).DownloadUrl, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).ValidTill, (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 GenerateDetailedCostReportOperationResult(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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrlTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DownloadUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).DownloadUrl = (string) content.GetValueForProperty("DownloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).DownloadUrl, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal)this).ValidTill, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The result of the long running operation for cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportOperationResultTypeConverter))] + public partial interface IGenerateDetailedCostReportOperationResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.TypeConverter.cs new file mode 100644 index 000000000000..ba4ce69a2dea --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.TypeConverter.cs @@ -0,0 +1,151 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateDetailedCostReportOperationResultTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateDetailedCostReportOperationResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportOperationResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportOperationResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.cs new file mode 100644 index 000000000000..0f67471870e2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.cs @@ -0,0 +1,133 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The result of the long running operation for cost detailed report. + public partial class GenerateDetailedCostReportOperationResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal + { + + /// The URL to download the generated report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DownloadUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)Property).DownloadUrl1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)Property).DownloadUrl1 = value ?? null; } + + /// Backing field for property. + private string _id; + + /// The id of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrl()); set { {_property = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl _property; + + /// The properties of the resource generated. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrl()); set => this._property = value; } + + /// Backing field for property. + private string _type; + + /// The type of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? ValidTill { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)Property).ValidTill; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)Property).ValidTill = value ?? default(global::System.DateTime); } + + /// + /// Creates an new instance. + /// + public GenerateDetailedCostReportOperationResult() + { + + } + } + /// The result of the long running operation for cost detailed report. + public partial interface IGenerateDetailedCostReportOperationResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The URL to download the generated report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL to download the generated report.", + SerializedName = @"downloadUrl", + PossibleTypes = new [] { typeof(string) })] + string DownloadUrl { get; set; } + /// The id of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The id of the long running operation.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The name of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the long running operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The type of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the long running operation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + global::System.DateTime? ValidTill { get; set; } + + } + /// The result of the long running operation for cost detailed report. + internal partial interface IGenerateDetailedCostReportOperationResultInternal + + { + /// The URL to download the generated report. + string DownloadUrl { get; set; } + /// The id of the long running operation. + string Id { get; set; } + /// The name of the long running operation. + string Name { get; set; } + /// The properties of the resource generated. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl Property { get; set; } + /// The type of the long running operation. + string Type { get; set; } + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + global::System.DateTime? ValidTill { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.json.cs new file mode 100644 index 000000000000..8e512e4433c6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationResult.json.cs @@ -0,0 +1,116 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The result of the long running operation for cost detailed report. + public partial class GenerateDetailedCostReportOperationResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateDetailedCostReportOperationResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateDetailedCostReportOperationResult(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrl.FromJson(__jsonProperties) : Property;} + {_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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.PowerShell.cs new file mode 100644 index 000000000000..74b9b793d463 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.PowerShell.cs @@ -0,0 +1,229 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The status of the long running operation for cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportOperationStatusesTypeConverter))] + public partial class GenerateDetailedCostReportOperationStatuses + { + + /// + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateDetailedCostReportOperationStatuses(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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateDetailedCostReportOperationStatuses(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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateDetailedCostReportOperationStatuses(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.StatusTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrlTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ReportOperationStatusTypeStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).ReportOperationStatusTypeStatus = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType?) content.GetValueForProperty("ReportOperationStatusTypeStatus",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).ReportOperationStatusTypeStatus, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType.CreateFrom); + } + if (content.Contains("DownloadUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).DownloadUrl = (string) content.GetValueForProperty("DownloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).DownloadUrl, global::System.Convert.ToString); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).ValidTill, (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 GenerateDetailedCostReportOperationStatuses(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.StatusTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrlTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ReportOperationStatusTypeStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).ReportOperationStatusTypeStatus = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType?) content.GetValueForProperty("ReportOperationStatusTypeStatus",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).ReportOperationStatusTypeStatus, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType.CreateFrom); + } + if (content.Contains("DownloadUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).DownloadUrl = (string) content.GetValueForProperty("DownloadUrl",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).DownloadUrl, global::System.Convert.ToString); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal)this).ValidTill, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The status of the long running operation for cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportOperationStatusesTypeConverter))] + public partial interface IGenerateDetailedCostReportOperationStatuses + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.TypeConverter.cs new file mode 100644 index 000000000000..98b108100ff7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.TypeConverter.cs @@ -0,0 +1,151 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateDetailedCostReportOperationStatusesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateDetailedCostReportOperationStatuses.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportOperationStatuses.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportOperationStatuses.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.cs new file mode 100644 index 000000000000..318560cc6e94 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.cs @@ -0,0 +1,205 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The status of the long running operation for cost detailed report. + public partial class GenerateDetailedCostReportOperationStatuses : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + + /// The URL to download the generated report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DownloadUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)Property).DownloadUrl1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)Property).DownloadUrl1 = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails _error; + + /// The details of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set => this._error = value; } + + /// Backing field for property. + private string _id; + + /// The id of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrl()); set { {_property = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatusesInternal.Status { get => (this._status = this._status ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Status()); set { {_status = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl _property; + + /// The properties of the resource generated. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrl()); set => this._property = value; } + + /// The status of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType? ReportOperationStatusTypeStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatusInternal)Status).Status1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatusInternal)Status).Status1 = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus _status; + + /// The status of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus Status { get => (this._status = this._status ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Status()); set => this._status = value; } + + /// Backing field for property. + private string _type; + + /// The type of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? ValidTill { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)Property).ValidTill; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrlInternal)Property).ValidTill = value ?? default(global::System.DateTime); } + + /// + /// Creates an new instance. + /// + public GenerateDetailedCostReportOperationStatuses() + { + + } + } + /// The status of the long running operation for cost detailed report. + public partial interface IGenerateDetailedCostReportOperationStatuses : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The URL to download the generated report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The URL to download the generated report.", + SerializedName = @"downloadUrl", + PossibleTypes = new [] { typeof(string) })] + string DownloadUrl { get; set; } + /// The id of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The id of the long running operation.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The name of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the long running operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The status of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status of the long running operation.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType? ReportOperationStatusTypeStatus { get; set; } + /// The type of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the long running operation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + global::System.DateTime? ValidTill { get; set; } + + } + /// The status of the long running operation for cost detailed report. + internal partial interface IGenerateDetailedCostReportOperationStatusesInternal + + { + /// Error code. + string Code { get; set; } + /// The URL to download the generated report. + string DownloadUrl { get; set; } + /// The details of the error. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get; set; } + /// The id of the long running operation. + string Id { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + /// The name of the long running operation. + string Name { get; set; } + /// The properties of the resource generated. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDownloadUrl Property { get; set; } + /// The status of the long running operation. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType? ReportOperationStatusTypeStatus { get; set; } + /// The status of the long running operation. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus Status { get; set; } + /// The type of the long running operation. + string Type { get; set; } + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + global::System.DateTime? ValidTill { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.json.cs new file mode 100644 index 000000000000..41e646439045 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportOperationStatuses.json.cs @@ -0,0 +1,120 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The status of the long running operation for cost detailed report. + public partial class GenerateDetailedCostReportOperationStatuses + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateDetailedCostReportOperationStatuses(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateDetailedCostReportOperationStatuses(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Status.FromJson(__jsonStatus) : Status;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails.FromJson(__jsonError) : Error;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DownloadUrl.FromJson(__jsonProperties) : Property;} + {_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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._status ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._status.ToJson(null,serializationMode) : null, "status" ,container.Add ); + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.PowerShell.cs new file mode 100644 index 000000000000..6e275e58764b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.PowerShell.cs @@ -0,0 +1,156 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The start and end date for pulling data for the cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportTimePeriodTypeConverter))] + public partial class GenerateDetailedCostReportTimePeriod + { + + /// + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateDetailedCostReportTimePeriod(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.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateDetailedCostReportTimePeriod(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.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateDetailedCostReportTimePeriod(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)this).Start, global::System.Convert.ToString); + } + if (content.Contains("End")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)this).End = (string) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)this).End, 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 GenerateDetailedCostReportTimePeriod(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)this).Start, global::System.Convert.ToString); + } + if (content.Contains("End")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)this).End = (string) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal)this).End, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The start and end date for pulling data for the cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportTimePeriodTypeConverter))] + public partial interface IGenerateDetailedCostReportTimePeriod + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.TypeConverter.cs new file mode 100644 index 000000000000..2a1b828734d2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.TypeConverter.cs @@ -0,0 +1,150 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateDetailedCostReportTimePeriodTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateDetailedCostReportTimePeriod.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportTimePeriod.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportTimePeriod.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.cs new file mode 100644 index 000000000000..321418183bc7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The start and end date for pulling data for the cost detailed report. + public partial class GenerateDetailedCostReportTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriodInternal + { + + /// Backing field for property. + private string _end; + + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string End { get => this._end; set => this._end = value; } + + /// Backing field for property. + private string _start; + + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Start { get => this._start; set => this._start = value; } + + /// Creates an new instance. + public GenerateDetailedCostReportTimePeriod() + { + + } + } + /// The start and end date for pulling data for the cost detailed report. + public partial interface IGenerateDetailedCostReportTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The end date to pull data to. example format 2020-03-15", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + string End { get; set; } + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date to pull data from. example format 2020-03-15", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + string Start { get; set; } + + } + /// The start and end date for pulling data for the cost detailed report. + internal partial interface IGenerateDetailedCostReportTimePeriodInternal + + { + /// The end date to pull data to. example format 2020-03-15 + string End { get; set; } + /// The start date to pull data from. example format 2020-03-15 + string Start { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.json.cs new file mode 100644 index 000000000000..6e3f45aba4a8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/GenerateDetailedCostReportTimePeriod.json.cs @@ -0,0 +1,111 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The start and end date for pulling data for the cost detailed report. + public partial class GenerateDetailedCostReportTimePeriod + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateDetailedCostReportTimePeriod(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateDetailedCostReportTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._start)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._start.ToString()) : null, "start" ,container.Add ); + AddIf( null != (((object)this._end)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._end.ToString()) : null, "end" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.PowerShell.cs new file mode 100644 index 000000000000..77fdc26970d2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.PowerShell.cs @@ -0,0 +1,160 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Each KPI must contain a 'type' and 'enabled' key. + [System.ComponentModel.TypeConverter(typeof(KpiPropertiesTypeConverter))] + public partial class KpiProperties + { + + /// + /// 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.Cost.Models.Api20211001.IKpiProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KpiProperties(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.Cost.Models.Api20211001.IKpiProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KpiProperties(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.Cost.Models.Api20211001.IKpiProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KpiProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KpiProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Each KPI must contain a 'type' and 'enabled' key. + [System.ComponentModel.TypeConverter(typeof(KpiPropertiesTypeConverter))] + public partial interface IKpiProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.TypeConverter.cs new file mode 100644 index 000000000000..d49769800aae --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KpiPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KpiProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KpiProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KpiProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.cs new file mode 100644 index 000000000000..3bf680a623fa --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.cs @@ -0,0 +1,85 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Each KPI must contain a 'type' and 'enabled' key. + public partial class KpiProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiPropertiesInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// show the KPI in the UI? + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _id; + + /// ID of resource related to metric (budget). + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType? _type; + + /// KPI type (Forecast, Budget). + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public KpiProperties() + { + + } + } + /// Each KPI must contain a 'type' and 'enabled' key. + public partial interface IKpiProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// show the KPI in the UI? + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"show the KPI in the UI?", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// ID of resource related to metric (budget). + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ID of resource related to metric (budget).", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// KPI type (Forecast, Budget). + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"KPI type (Forecast, Budget).", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType? Type { get; set; } + + } + /// Each KPI must contain a 'type' and 'enabled' key. + internal partial interface IKpiPropertiesInternal + + { + /// show the KPI in the UI? + bool? Enabled { get; set; } + /// ID of resource related to metric (budget). + string Id { get; set; } + /// KPI type (Forecast, Budget). + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.json.cs new file mode 100644 index 000000000000..f308b2bb71b5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/KpiProperties.json.cs @@ -0,0 +1,112 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Each KPI must contain a 'type' and 'enabled' key. + public partial class KpiProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new KpiProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal KpiProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.PowerShell.cs new file mode 100644 index 000000000000..49905f55e801 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.PowerShell.cs @@ -0,0 +1,192 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// A Cost management REST API operation. + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial class Operation + { + + /// + /// 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.Cost.Models.Api20211001.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Operation(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.Cost.Models.Api20211001.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Operation(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.Cost.Models.Api20211001.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Operation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayDescription, 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 Operation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal)this).DisplayDescription, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A Cost management REST API operation. + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial interface IOperation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.TypeConverter.cs new file mode 100644 index 000000000000..6be3fad9d1e4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Operation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Operation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Operation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.cs new file mode 100644 index 000000000000..a3215d6be6e2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.cs @@ -0,0 +1,154 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// A Cost management REST API operation. + public partial class Operation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay _display; + + /// The object that represents the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationDisplay()); set => this._display = value; } + + /// Operation description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Description; } + + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Operation; } + + /// Service provider: Microsoft.CostManagement. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Provider; } + + /// Resource on which the operation is performed: Dimensions, Query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Resource; } + + /// Backing field for property. + private string _id; + + /// Operation id: {provider}/{resource}/{operation}. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationDisplay()); set { {_display = value;} } } + + /// Internal Acessors for DisplayDescription + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Description = value; } + + /// Internal Acessors for DisplayOperation + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Operation = value; } + + /// Internal Acessors for DisplayProvider + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Provider = value; } + + /// Internal Acessors for DisplayResource + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)Display).Resource = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationInternal.Name { get => this._name; set { {_name = value;} } } + + /// Backing field for property. + private string _name; + + /// Operation name: {provider}/{resource}/{operation}. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Creates an new instance. + public Operation() + { + + } + } + /// A Cost management REST API operation. + public partial interface IOperation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Operation description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; } + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation type: Read, write, delete, etc.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; } + /// Service provider: Microsoft.CostManagement. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service provider: Microsoft.CostManagement.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; } + /// Resource on which the operation is performed: Dimensions, Query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource on which the operation is performed: Dimensions, Query.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; } + /// Operation id: {provider}/{resource}/{operation}. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation id: {provider}/{resource}/{operation}.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Operation name: {provider}/{resource}/{operation}. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation name: {provider}/{resource}/{operation}.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + } + /// A Cost management REST API operation. + internal partial interface IOperationInternal + + { + /// The object that represents the operation. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay Display { get; set; } + /// Operation description + string DisplayDescription { get; set; } + /// Operation type: Read, write, delete, etc. + string DisplayOperation { get; set; } + /// Service provider: Microsoft.CostManagement. + string DisplayProvider { get; set; } + /// Resource on which the operation is performed: Dimensions, Query. + string DisplayResource { get; set; } + /// Operation id: {provider}/{resource}/{operation}. + string Id { get; set; } + /// Operation name: {provider}/{resource}/{operation}. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.json.cs new file mode 100644 index 000000000000..4a722b0477a6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Operation.json.cs @@ -0,0 +1,118 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// A Cost management REST API operation. + public partial class Operation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new Operation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal Operation(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..c8f31044f7bb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.PowerShell.cs @@ -0,0 +1,168 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The object that represents the operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial class OperationDisplay + { + + /// + /// 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.Cost.Models.Api20211001.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationDisplay(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.Cost.Models.Api20211001.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationDisplay(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.Cost.Models.Api20211001.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationDisplay(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Description, 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 OperationDisplay(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal)this).Description, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The object that represents the operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial interface IOperationDisplay + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..c161c5215458 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationDisplayTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.cs new file mode 100644 index 000000000000..0d0bcf9edf46 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.cs @@ -0,0 +1,114 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The object that represents the operation. + public partial class OperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// Operation description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Operation + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + + /// Internal Acessors for Provider + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + + /// Internal Acessors for Resource + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } + + /// Backing field for property. + private string _operation; + + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Operation { get => this._operation; } + + /// Backing field for property. + private string _provider; + + /// Service provider: Microsoft.CostManagement. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Provider { get => this._provider; } + + /// Backing field for property. + private string _resource; + + /// Resource on which the operation is performed: Dimensions, Query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Resource { get => this._resource; } + + /// Creates an new instance. + public OperationDisplay() + { + + } + } + /// The object that represents the operation. + public partial interface IOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Operation description + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Operation type: Read, write, delete, etc.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; } + /// Service provider: Microsoft.CostManagement. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Service provider: Microsoft.CostManagement.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; } + /// Resource on which the operation is performed: Dimensions, Query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource on which the operation is performed: Dimensions, Query.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; } + + } + /// The object that represents the operation. + internal partial interface IOperationDisplayInternal + + { + /// Operation description + string Description { get; set; } + /// Operation type: Read, write, delete, etc. + string Operation { get; set; } + /// Service provider: Microsoft.CostManagement. + string Provider { get; set; } + /// Resource on which the operation is performed: Dimensions, Query. + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.json.cs new file mode 100644 index 000000000000..8f93f0e41473 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationDisplay.json.cs @@ -0,0 +1,126 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The object that represents the operation. + public partial class OperationDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.PowerShell.cs new file mode 100644 index 000000000000..387a2943f1c6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.PowerShell.cs @@ -0,0 +1,154 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// 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))] + public partial class OperationListResult + { + + /// + /// 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.Cost.Models.Api20211001.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationListResult(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.Cost.Models.Api20211001.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationListResult(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.Cost.Models.Api20211001.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal)this).NextLink, 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 OperationListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.OperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal)this).NextLink, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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))] + public partial interface IOperationListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.TypeConverter.cs new file mode 100644 index 000000000000..b6bc7a77e2f6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationListResultTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.cs new file mode 100644 index 000000000000..5206e46da472 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.cs @@ -0,0 +1,82 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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.Cost.Models.Api20211001.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// URL to get the next set of operation list results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation[] _value; + + /// + /// List of cost management operations supported by the Microsoft.CostManagement resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation[] Value { get => this._value; } + + /// Creates an new instance. + public OperationListResult() + { + + } + } + /// 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 interface IOperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// URL to get the next set of operation list results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"URL to get the next set of operation list results if there are any.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// + /// List of cost management operations supported by the Microsoft.CostManagement resource provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of cost management operations supported by the Microsoft.CostManagement resource provider.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation[] 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. + internal partial interface IOperationListResultInternal + + { + /// URL to get the next set of operation list results if there are any. + string NextLink { get; set; } + /// + /// List of cost management operations supported by the Microsoft.CostManagement resource provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.json.cs new file mode 100644 index 000000000000..2a1f07a7805c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationListResult.json.cs @@ -0,0 +1,126 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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 + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Operation.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.PowerShell.cs new file mode 100644 index 000000000000..7fbdbdbef7c3 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.PowerShell.cs @@ -0,0 +1,168 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The status of the long running operation. + [System.ComponentModel.TypeConverter(typeof(OperationStatusTypeConverter))] + public partial class OperationStatus + { + + /// + /// 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.Cost.Models.Api20211001.IOperationStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatus(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.Cost.Models.Api20211001.IOperationStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatus(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.Cost.Models.Api20211001.IOperationStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatus(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.Cost.Models.Api20211001.IOperationStatusInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportUrlTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType.CreateFrom); + } + if (content.Contains("ReportUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).ReportUrl = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema?) content.GetValueForProperty("ReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).ReportUrl, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema.CreateFrom); + } + if (content.Contains("ValidUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationStatus(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.Cost.Models.Api20211001.IOperationStatusInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportUrlTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType.CreateFrom); + } + if (content.Contains("ReportUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).ReportUrl = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema?) content.GetValueForProperty("ReportUrl",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).ReportUrl, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema.CreateFrom); + } + if (content.Contains("ValidUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The status of the long running operation. + [System.ComponentModel.TypeConverter(typeof(OperationStatusTypeConverter))] + public partial interface IOperationStatus + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.TypeConverter.cs new file mode 100644 index 000000000000..e6426b9f13c5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatus.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatus.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatus.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.cs new file mode 100644 index 000000000000..76452d5791f0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.cs @@ -0,0 +1,97 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The status of the long running operation. + public partial class OperationStatus : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal + { + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatusInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportUrl()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl _property; + + /// The properties of the resource generated. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema? ReportUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)Property).ReportUrl1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)Property).ReportUrl1 = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType? _status; + + /// The status of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType? Status { get => this._status; set => this._status = value; } + + /// The time at which report URL becomes invalid. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? ValidUntil { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)Property).ValidUntil; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)Property).ValidUntil = value ?? default(global::System.DateTime); } + + /// Creates an new instance. + public OperationStatus() + { + + } + } + /// The status of the long running operation. + public partial interface IOperationStatus : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Support.ReservationReportSchema) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema? ReportUrl { get; set; } + /// The status of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status of the long running operation.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType? Status { get; set; } + /// The time at which report URL becomes invalid. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time at which report URL becomes invalid.", + SerializedName = @"validUntil", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ValidUntil { get; set; } + + } + /// The status of the long running operation. + internal partial interface IOperationStatusInternal + + { + /// The properties of the resource generated. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Support.ReservationReportSchema? ReportUrl { get; set; } + /// The status of the long running operation. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType? Status { get; set; } + /// The time at which report URL becomes invalid. + global::System.DateTime? ValidUntil { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.json.cs new file mode 100644 index 000000000000..3b2b32b2822a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/OperationStatus.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The status of the long running operation. + public partial class OperationStatus + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new OperationStatus(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatus(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportUrl.FromJson(__jsonProperties) : Property;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.PowerShell.cs new file mode 100644 index 000000000000..3303135f3384 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Each pivot must contain a 'type' and 'name'. + [System.ComponentModel.TypeConverter(typeof(PivotPropertiesTypeConverter))] + public partial class PivotProperties + { + + /// + /// 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.Cost.Models.Api20211001.IPivotProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PivotProperties(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.Cost.Models.Api20211001.IPivotProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PivotProperties(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.Cost.Models.Api20211001.IPivotProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PivotProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType.CreateFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotPropertiesInternal)this).Name, 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 PivotProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType.CreateFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotPropertiesInternal)this).Name, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Each pivot must contain a 'type' and 'name'. + [System.ComponentModel.TypeConverter(typeof(PivotPropertiesTypeConverter))] + public partial interface IPivotProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.TypeConverter.cs new file mode 100644 index 000000000000..4ee483c21e5f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PivotPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PivotProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PivotProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PivotProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.cs new file mode 100644 index 000000000000..22ec009508bf --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Each pivot must contain a 'type' and 'name'. + public partial class PivotProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotPropertiesInternal + { + + /// Backing field for property. + private string _name; + + /// Data field to show in view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType? _type; + + /// Data type to show in view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public PivotProperties() + { + + } + } + /// Each pivot must contain a 'type' and 'name'. + public partial interface IPivotProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Data field to show in view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data field to show in view.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Data type to show in view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Data type to show in view.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType? Type { get; set; } + + } + /// Each pivot must contain a 'type' and 'name'. + internal partial interface IPivotPropertiesInternal + + { + /// Data field to show in view. + string Name { get; set; } + /// Data type to show in view. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.json.cs new file mode 100644 index 000000000000..f5b5d99216e2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/PivotProperties.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Each pivot must contain a 'type' and 'name'. + public partial class PivotProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new PivotProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal PivotProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.PowerShell.cs new file mode 100644 index 000000000000..ac91e5cba0bb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.PowerShell.cs @@ -0,0 +1,168 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The Resource model definition. + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial class ProxyResource + { + + /// + /// 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.Cost.Models.Api20211001.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProxyResource(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.Cost.Models.Api20211001.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProxyResource(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.Cost.Models.Api20211001.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProxyResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, 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 ProxyResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Resource model definition. + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial interface IProxyResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.TypeConverter.cs new file mode 100644 index 000000000000..9733d3330061 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProxyResourceTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProxyResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProxyResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProxyResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.cs new file mode 100644 index 000000000000..9751d6a3ab4e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.cs @@ -0,0 +1,120 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The Resource model definition. + public partial class ProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal + { + + /// Backing field for property. + private string _eTag; + + /// + /// eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating + /// the latest version or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Backing field for property. + private string _id; + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ProxyResource() + { + + } + } + /// The Resource model definition. + public partial interface IProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string ETag { get; set; } + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Id.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The Resource model definition. + internal partial interface IProxyResourceInternal + + { + /// + /// 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. + /// + string ETag { get; set; } + /// Resource Id. + string Id { get; set; } + /// Resource name. + string Name { get; set; } + /// Resource type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.json.cs new file mode 100644 index 000000000000..100ff56707c0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ProxyResource.json.cs @@ -0,0 +1,123 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The Resource model definition. + public partial class ProxyResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._eTag.ToString()) : null, "eTag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.PowerShell.cs new file mode 100644 index 000000000000..c2b9bc33da61 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The aggregation expression to be used in the query. + [System.ComponentModel.TypeConverter(typeof(QueryAggregationTypeConverter))] + public partial class QueryAggregation + { + + /// + /// 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.Cost.Models.Api20211001.IQueryAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryAggregation(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.Cost.Models.Api20211001.IQueryAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryAggregation(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.Cost.Models.Api20211001.IQueryAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryAggregation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Function")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal)this).Function, 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 QueryAggregation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Function")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal)this).Function, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The aggregation expression to be used in the query. + [System.ComponentModel.TypeConverter(typeof(QueryAggregationTypeConverter))] + public partial interface IQueryAggregation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.TypeConverter.cs new file mode 100644 index 000000000000..7c0c5552b8b4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryAggregationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryAggregation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryAggregation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryAggregation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.cs new file mode 100644 index 000000000000..88ddb0ef4129 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.cs @@ -0,0 +1,71 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The aggregation expression to be used in the query. + public partial class QueryAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregation, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal + { + + /// Backing field for property. + private string _function= @"Sum"; + + /// The name of the aggregation function to use. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Function { get => this._function; } + + /// Internal Acessors for Function + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregationInternal.Function { get => this._function; set { {_function = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the column to aggregate. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public QueryAggregation() + { + + } + } + /// The aggregation expression to be used in the query. + public partial interface IQueryAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The name of the aggregation function to use. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The name of the aggregation function to use.", + SerializedName = @"function", + PossibleTypes = new [] { typeof(string) })] + string Function { get; } + /// The name of the column to aggregate. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the column to aggregate.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// The aggregation expression to be used in the query. + internal partial interface IQueryAggregationInternal + + { + /// The name of the aggregation function to use. + string Function { get; set; } + /// The name of the column to aggregate. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.json.cs new file mode 100644 index 000000000000..64f764d0239a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryAggregation.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The aggregation expression to be used in the query. + public partial class QueryAggregation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryAggregation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryAggregation(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._function)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._function.ToString()) : null, "function" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.PowerShell.cs new file mode 100644 index 000000000000..3e5bcc84f7b4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// QueryColumn properties + [System.ComponentModel.TypeConverter(typeof(QueryColumnTypeConverter))] + public partial class QueryColumn + { + + /// + /// 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.Cost.Models.Api20211001.IQueryColumn DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryColumn(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.Cost.Models.Api20211001.IQueryColumn DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryColumn(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.Cost.Models.Api20211001.IQueryColumn FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryColumn(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumnInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumnInternal)this).Type, 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 QueryColumn(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumnInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumnInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumnInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumnInternal)this).Type, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// QueryColumn properties + [System.ComponentModel.TypeConverter(typeof(QueryColumnTypeConverter))] + public partial interface IQueryColumn + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.TypeConverter.cs new file mode 100644 index 000000000000..6a60179e3418 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryColumnTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryColumn.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryColumn.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryColumn.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.cs new file mode 100644 index 000000000000..8f1575851908 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// QueryColumn properties + public partial class QueryColumn : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumnInternal + { + + /// Backing field for property. + private string _name; + + /// The name of column. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _type; + + /// The type of column. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public QueryColumn() + { + + } + } + /// QueryColumn properties + public partial interface IQueryColumn : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The name of column. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of column.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The type of column. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of column.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// QueryColumn properties + internal partial interface IQueryColumnInternal + + { + /// The name of column. + string Name { get; set; } + /// The type of column. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.json.cs new file mode 100644 index 000000000000..456faadbfa67 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryColumn.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// QueryColumn properties + public partial class QueryColumn + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryColumn(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryColumn(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.PowerShell.cs new file mode 100644 index 000000000000..77794f3b2a25 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.PowerShell.cs @@ -0,0 +1,160 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The comparison expression to be used in the query. + [System.ComponentModel.TypeConverter(typeof(QueryComparisonExpressionTypeConverter))] + public partial class QueryComparisonExpression + { + + /// + /// 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.Cost.Models.Api20211001.IQueryComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryComparisonExpression(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.Cost.Models.Api20211001.IQueryComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryComparisonExpression(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.Cost.Models.Api20211001.IQueryComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryComparisonExpression(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Value, __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 QueryComparisonExpression(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Operator, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)this).Value, __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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The comparison expression to be used in the query. + [System.ComponentModel.TypeConverter(typeof(QueryComparisonExpressionTypeConverter))] + public partial interface IQueryComparisonExpression + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.TypeConverter.cs new file mode 100644 index 000000000000..3d5248567888 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryComparisonExpressionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryComparisonExpression.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryComparisonExpression.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryComparisonExpression.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.cs new file mode 100644 index 000000000000..41e6fd9e7c3c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.cs @@ -0,0 +1,88 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The comparison expression to be used in the query. + public partial class QueryComparisonExpression : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal + { + + /// Internal Acessors for Operator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal.Operator { get => this._operator; set { {_operator = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _operator= @"In"; + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Operator { get => this._operator; } + + /// Backing field for property. + private string[] _value; + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public QueryComparisonExpression() + { + + } + } + /// The comparison expression to be used in the query. + public partial interface IQueryComparisonExpression : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string Operator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// The comparison expression to be used in the query. + internal partial interface IQueryComparisonExpressionInternal + + { + /// The name of the column to use in comparison. + string Name { get; set; } + /// The operator to use for comparison. + string Operator { get; set; } + /// Array of values to use for comparison + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.json.cs new file mode 100644 index 000000000000..2eb56c7dd944 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryComparisonExpression.json.cs @@ -0,0 +1,120 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The comparison expression to be used in the query. + public partial class QueryComparisonExpression + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryComparisonExpression(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryComparisonExpression(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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.Cost.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.Cost.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._operator)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._operator.ToString()) : null, "operator" ,container.Add ); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.PowerShell.cs new file mode 100644 index 000000000000..97d974117c50 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.PowerShell.cs @@ -0,0 +1,264 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The definition of data present in the query. + [System.ComponentModel.TypeConverter(typeof(QueryDatasetTypeConverter))] + public partial class QueryDataset + { + + /// + /// 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.Cost.Models.Api20211001.IQueryDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryDataset(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.Cost.Models.Api20211001.IQueryDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryDataset(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.Cost.Models.Api20211001.IQueryDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryDataset(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.Cost.Models.Api20211001.IQueryDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("Aggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("Grouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[]) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)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 QueryDataset(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.Cost.Models.Api20211001.IQueryDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("Aggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("Grouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[]) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)this).TagValue, __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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The definition of data present in the query. + [System.ComponentModel.TypeConverter(typeof(QueryDatasetTypeConverter))] + public partial interface IQueryDataset + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.TypeConverter.cs new file mode 100644 index 000000000000..069f0a667590 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryDatasetTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryDataset.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryDataset.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryDataset.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.cs new file mode 100644 index 000000000000..86f03052d216 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.cs @@ -0,0 +1,287 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of data present in the query. + public partial class QueryDataset : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation Aggregation { get => (this._aggregation = this._aggregation ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetAggregation()); set => this._aggregation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).DimensionName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).DimensionOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).DimensionValue = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilter()); set => this._filter = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).And; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).And = value ?? null /* arrayOf */; } + + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).Or; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).Or = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? _granularity; + + /// The granularity of rows in the query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? Granularity { get => this._granularity; set => this._granularity = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] _grouping; + + /// + /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] Grouping { get => this._grouping; set => this._grouping = value; } + + /// Internal Acessors for Configuration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetConfiguration()); set { {_configuration = value;} } } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).DimensionOperator = value; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilter()); set { {_filter = value;} } } + + /// Internal Acessors for FilterDimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).Dimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).Dimension = value; } + + /// Internal Acessors for FilterTag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).Tag = value; } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).TagOperator = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).TagName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).TagOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)Filter).TagValue = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public QueryDataset() + { + + } + } + /// The definition of data present in the query. + public partial interface IQueryDataset : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DimensionName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string DimensionOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] DimensionValue { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get; set; } + /// The granularity of rows in the query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the query.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryGrouping) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] Grouping { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string TagOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + + } + /// The definition of data present in the query. + internal 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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; } + /// 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; } + /// + /// 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.Cost.Models.Api20211001.IQueryFilter Filter { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression FilterDimension { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression FilterTag { get; set; } + /// The granularity of rows in the query. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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.Cost.Models.Api20211001.IQueryGrouping[] Grouping { 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; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.json.cs new file mode 100644 index 000000000000..b85b30cba4db --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDataset.json.cs @@ -0,0 +1,124 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of data present in the query. + public partial class QueryDataset + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryDataset(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryDataset(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetConfiguration.FromJson(__jsonConfiguration) : Configuration;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilter.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.Cost.Models.Api20211001.QueryDatasetAggregation.FromJson(__jsonAggregation) : Aggregation;} + {_grouping = If( json?.PropertyT("grouping"), out var __jsonGrouping) ? If( __jsonGrouping as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IQueryGrouping) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryGrouping.FromJson(__u) )) ))() : null : Grouping;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._configuration ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._configuration.ToJson(null,serializationMode) : null, "configuration" ,container.Add ); + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filter" ,container.Add ); + AddIf( null != (((object)this._granularity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._granularity.ToString()) : null, "granularity" ,container.Add ); + AddIf( null != this._aggregation ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._aggregation.ToJson(null,serializationMode) : null, "aggregation" ,container.Add ); + if (null != this._grouping) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._grouping ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("grouping",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.PowerShell.cs new file mode 100644 index 000000000000..c255c87eceab --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.PowerShell.cs @@ -0,0 +1,144 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(QueryDatasetAggregationTypeConverter))] + public partial class QueryDatasetAggregation + { + + /// + /// 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.Cost.Models.Api20211001.IQueryDatasetAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryDatasetAggregation(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.Cost.Models.Api20211001.IQueryDatasetAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryDatasetAggregation(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.Cost.Models.Api20211001.IQueryDatasetAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryDatasetAggregation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueryDatasetAggregation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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. + [System.ComponentModel.TypeConverter(typeof(QueryDatasetAggregationTypeConverter))] + public partial interface IQueryDatasetAggregation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.TypeConverter.cs new file mode 100644 index 000000000000..4ebe6703e356 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryDatasetAggregationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryDatasetAggregation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryDatasetAggregation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryDatasetAggregation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.cs new file mode 100644 index 000000000000..163e49548b8e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.cs @@ -0,0 +1,40 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class QueryDatasetAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregationInternal + { + + /// Creates an new instance. + public QueryDatasetAggregation() + { + + } + } + /// 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. + public partial interface IQueryDatasetAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray + { + + } + /// 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. + internal partial interface IQueryDatasetAggregationInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.dictionary.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.dictionary.cs new file mode 100644 index 000000000000..5a3f1b6f0ec9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.dictionary.cs @@ -0,0 +1,75 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class QueryDatasetAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregation this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregation value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryAggregation value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetAggregation source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.json.cs new file mode 100644 index 000000000000..7e5ba298de11 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetAggregation.json.cs @@ -0,0 +1,112 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class QueryDatasetAggregation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryDatasetAggregation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + /// + internal QueryDatasetAggregation(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryAggregation.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.PowerShell.cs new file mode 100644 index 000000000000..054c12020fb0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.PowerShell.cs @@ -0,0 +1,144 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The configuration of dataset in the query. + [System.ComponentModel.TypeConverter(typeof(QueryDatasetConfigurationTypeConverter))] + public partial class QueryDatasetConfiguration + { + + /// + /// 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.Cost.Models.Api20211001.IQueryDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryDatasetConfiguration(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.Cost.Models.Api20211001.IQueryDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryDatasetConfiguration(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.Cost.Models.Api20211001.IQueryDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryDatasetConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfigurationInternal)this).Column, __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 QueryDatasetConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfigurationInternal)this).Column, __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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The configuration of dataset in the query. + [System.ComponentModel.TypeConverter(typeof(QueryDatasetConfigurationTypeConverter))] + public partial interface IQueryDatasetConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..8b754a0ec6be --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryDatasetConfigurationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryDatasetConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryDatasetConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryDatasetConfiguration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.cs new file mode 100644 index 000000000000..accebc6d7a45 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.cs @@ -0,0 +1,60 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The configuration of dataset in the query. + public partial class QueryDatasetConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfigurationInternal + { + + /// Backing field for property. + private string[] _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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] Column { get => this._column; set => this._column = value; } + + /// Creates an new instance. + public QueryDatasetConfiguration() + { + + } + } + /// The configuration of dataset in the query. + public partial interface IQueryDatasetConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + + } + /// The configuration of dataset in the query. + internal 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; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.json.cs new file mode 100644 index 000000000000..fdebf031194a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDatasetConfiguration.json.cs @@ -0,0 +1,116 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The configuration of dataset in the query. + public partial class QueryDatasetConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryDatasetConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryDatasetConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Column;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._column) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._column ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("columns",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.PowerShell.cs new file mode 100644 index 000000000000..34b13933be71 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.PowerShell.cs @@ -0,0 +1,312 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IQueryDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("DatasetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[]) content.GetValueForProperty("DatasetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)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 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.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Dataset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Dataset = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset) content.GetValueForProperty("Dataset",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Dataset, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType.CreateFrom); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType.CreateFrom); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration) content.GetValueForProperty("DatasetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) content.GetValueForProperty("DatasetFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType?) content.GetValueForProperty("DatasetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType.CreateFrom); + } + if (content.Contains("DatasetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation) content.GetValueForProperty("DatasetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetAggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DatasetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[]) content.GetValueForProperty("DatasetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DatasetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal)this).TagValue, __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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.TypeConverter.cs new file mode 100644 index 000000000000..298a8f0694a9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryDefinitionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.cs new file mode 100644 index 000000000000..707c33ff56ee --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.cs @@ -0,0 +1,350 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a query. + public partial class QueryDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset _dataset; + + /// Has definition for data in this query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation DatasetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Aggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Aggregation = value ?? null /* model class */; } + + /// The granularity of rows in the query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? DatasetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Granularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); } + + /// + /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] DatasetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Grouping = value ?? null /* arrayOf */; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).DimensionName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).DimensionOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).DimensionValue = value ?? null /* arrayOf */; } + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).FilterAnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).FilterAnd = value ?? null /* arrayOf */; } + + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).FilterOr; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).FilterOr = value ?? null /* arrayOf */; } + + /// Internal Acessors for Dataset + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDataset Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal.Dataset { get => (this._dataset = this._dataset ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDataset()); set { {_dataset = value;} } } + + /// Internal Acessors for DatasetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal.DatasetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Configuration = value; } + + /// Internal Acessors for DatasetFilter + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal.DatasetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).Filter = value; } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).DimensionOperator = value; } + + /// Internal Acessors for FilterDimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).FilterDimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).FilterDimension = value; } + + /// Internal Acessors for FilterTag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).FilterTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).FilterTag = value; } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).TagOperator = value; } + + /// Internal Acessors for TimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryTimePeriod()); set { {_timePeriod = value;} } } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).TagName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).TagOperator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetInternal)Dataset).TagValue = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod _timePeriod; + + /// Has time period for pulling data for the query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryTimePeriod()); set => this._timePeriod = value; } + + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } + + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType _timeframe; + + /// + /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType Timeframe { get => this._timeframe; set => this._timeframe = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType _type; + + /// The type of the query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public QueryDefinition() + { + + } + } + /// The definition of a query. + public partial interface IQueryDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation DatasetAggregation { get; set; } + /// The granularity of rows in the query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the query.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryGrouping) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] DatasetGrouping { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DimensionName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string DimensionOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] DimensionValue { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string TagOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodTo { get; set; } + /// + /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.TimeframeType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType Timeframe { get; set; } + /// The type of the query. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the query.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType Type { get; set; } + + } + /// The definition of a query. + internal 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; } + /// Has definition for data in this query. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IQueryFilter DatasetFilter { get; set; } + /// The granularity of rows in the query. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType? 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.Cost.Models.Api20211001.IQueryGrouping[] DatasetGrouping { 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; } + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression FilterDimension { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression FilterTag { 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; } + /// Has time period for pulling data for the query. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod TimePeriod { get; set; } + /// The start date to pull data from. + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date to pull data to. + global::System.DateTime? TimePeriodTo { get; set; } + /// + /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. + /// + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType Timeframe { get; set; } + /// The type of the query. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.json.cs new file mode 100644 index 000000000000..5aaef5f1d93e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryDefinition.json.cs @@ -0,0 +1,114 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a query. + public partial class QueryDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryDefinition(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryDefinition(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} + {_dataset = If( json?.PropertyT("dataset"), out var __jsonDataset) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._timePeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._timePeriod.ToJson(null,serializationMode) : null, "timePeriod" ,container.Add ); + AddIf( null != this._dataset ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._dataset.ToJson(null,serializationMode) : null, "dataset" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._timeframe)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._timeframe.ToString()) : null, "timeframe" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.PowerShell.cs new file mode 100644 index 000000000000..b472962e04ca --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.PowerShell.cs @@ -0,0 +1,216 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The filter expression to be used in the export. + [System.ComponentModel.TypeConverter(typeof(QueryFilterTypeConverter))] + public partial class QueryFilter + { + + /// + /// 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.Cost.Models.Api20211001.IQueryFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryFilter(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.Cost.Models.Api20211001.IQueryFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryFilter(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.Cost.Models.Api20211001.IQueryFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("And")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("Or")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)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 QueryFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("And")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("Or")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionOperator = (string) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionOperator, global::System.Convert.ToString); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagOperator = (string) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagOperator, global::System.Convert.ToString); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal)this).TagValue, __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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The filter expression to be used in the export. + [System.ComponentModel.TypeConverter(typeof(QueryFilterTypeConverter))] + public partial interface IQueryFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.TypeConverter.cs new file mode 100644 index 000000000000..1debcb4c86c2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryFilterTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.cs new file mode 100644 index 000000000000..216361bb93c1 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.cs @@ -0,0 +1,182 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The filter expression to be used in the export. + public partial class QueryFilter : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] _and; + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] And { get => this._and; set => this._and = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression _dimension; + + /// Has comparison expression for a dimension + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression()); set => this._dimension = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Dimension).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Dimension).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Dimension).Operator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Dimension).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Dimension).Value = value ?? null /* arrayOf */; } + + /// Internal Acessors for Dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal.Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression()); set { {_dimension = value;} } } + + /// Internal Acessors for DimensionOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal.DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Dimension).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Dimension).Operator = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression()); set { {_tag = value;} } } + + /// Internal Acessors for TagOperator + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilterInternal.TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Tag).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Tag).Operator = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] _or; + + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] Or { get => this._or; set => this._or = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression _tag; + + /// Has comparison expression for a tag + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression()); set => this._tag = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Tag).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Tag).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Tag).Operator; } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Tag).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpressionInternal)Tag).Value = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public QueryFilter() + { + + } + } + /// The filter expression to be used in the export. + public partial interface IQueryFilter : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] And { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DimensionName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string DimensionOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] DimensionValue { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] Or { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(string) })] + string TagOperator { get; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + + } + /// The filter expression to be used in the export. + internal partial interface IQueryFilterInternal + + { + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] And { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression 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; } + /// The logical "OR" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] Or { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryComparisonExpression 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; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.json.cs new file mode 100644 index 000000000000..7c73920190f9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryFilter.json.cs @@ -0,0 +1,130 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The filter expression to be used in the export. + public partial class QueryFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryFilter(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression.FromJson(__jsonDimensions) : Dimension;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression.FromJson(__jsonTags) : Tag;} + {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IQueryFilter) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilter.FromJson(__u) )) ))() : null : And;} + {_or = If( json?.PropertyT("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IQueryFilter) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilter.FromJson(__p) )) ))() : null : Or;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._dimension ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._dimension.ToJson(null,serializationMode) : null, "dimensions" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + if (null != this._and) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._and ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("and",__w); + } + if (null != this._or) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __s in this._or ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("or",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.PowerShell.cs new file mode 100644 index 000000000000..a9ab5b752a53 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The group by expression to be used in the query. + [System.ComponentModel.TypeConverter(typeof(QueryGroupingTypeConverter))] + public partial class QueryGrouping + { + + /// + /// 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.Cost.Models.Api20211001.IQueryGrouping DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryGrouping(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.Cost.Models.Api20211001.IQueryGrouping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryGrouping(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.Cost.Models.Api20211001.IQueryGrouping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryGrouping(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGroupingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGroupingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType.CreateFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGroupingInternal)this).Name, 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 QueryGrouping(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGroupingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGroupingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType.CreateFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGroupingInternal)this).Name, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The group by expression to be used in the query. + [System.ComponentModel.TypeConverter(typeof(QueryGroupingTypeConverter))] + public partial interface IQueryGrouping + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.TypeConverter.cs new file mode 100644 index 000000000000..060fa5507b38 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryGroupingTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryGrouping.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryGrouping.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryGrouping.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.cs new file mode 100644 index 000000000000..eb49964ff1da --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The group by expression to be used in the query. + public partial class QueryGrouping : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGroupingInternal + { + + /// Backing field for property. + private string _name; + + /// The name of the column to group. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType _type; + + /// Has type of the column to group. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public QueryGrouping() + { + + } + } + /// The group by expression to be used in the query. + public partial interface IQueryGrouping : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The name of the column to group. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the column to group.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Has type of the column to group. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Has type of the column to group.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType Type { get; set; } + + } + /// The group by expression to be used in the query. + internal 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.Cost.Support.QueryColumnType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.json.cs new file mode 100644 index 000000000000..3c8709a5a1a4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryGrouping.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The group by expression to be used in the query. + public partial class QueryGrouping + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryGrouping(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryGrouping(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.PowerShell.cs new file mode 100644 index 000000000000..a45d0d01284a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.PowerShell.cs @@ -0,0 +1,160 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Query properties + [System.ComponentModel.TypeConverter(typeof(QueryPropertiesTypeConverter))] + public partial class QueryProperties + { + + /// + /// 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.Cost.Models.Api20211001.IQueryProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryProperties(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.Cost.Models.Api20211001.IQueryProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryProperties(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.Cost.Models.Api20211001.IQueryProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryColumnTypeConverter.ConvertFrom)); + } + if (content.Contains("Row")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueryProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryColumnTypeConverter.ConvertFrom)); + } + if (content.Contains("Row")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom))); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Query properties + [System.ComponentModel.TypeConverter(typeof(QueryPropertiesTypeConverter))] + public partial interface IQueryProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.TypeConverter.cs new file mode 100644 index 000000000000..bffa74d893c7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.cs new file mode 100644 index 000000000000..5d789fef6221 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.cs @@ -0,0 +1,85 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Query properties + public partial class QueryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[] _column; + + /// Array of columns + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[] Column { get => this._column; set => this._column = value; } + + /// Backing field for property. + private string _nextLink; + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] _row; + + /// Array of rows + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get => this._row; set => this._row = value; } + + /// Creates an new instance. + public QueryProperties() + { + + } + } + /// Query properties + public partial interface IQueryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Array of columns + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of columns", + SerializedName = @"columns", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[] Column { get; set; } + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The link (url) to the next page of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Array of rows + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of rows", + SerializedName = @"rows", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get; set; } + + } + /// Query properties + internal partial interface IQueryPropertiesInternal + + { + /// Array of columns + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[] Column { get; set; } + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// Array of rows + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.json.cs new file mode 100644 index 000000000000..b723c2d133fe --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryProperties.json.cs @@ -0,0 +1,128 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Query properties + public partial class QueryProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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.Cost.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.Cost.Models.Api20211001.IQueryColumn) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryColumn.FromJson(__u) )) ))() : null : Column;} + {_row = If( json?.PropertyT("rows"), out var __jsonRows) ? If( __jsonRows as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.IAny[]) (If( __o as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.IAny) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Any.FromJson(__m) )) ))() : null /* arrayOf */)) ))() : null : Row;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + if (null != this._column) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._column ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("columns",__w); + } + if (null != this._row) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __s in this._row ) + { + AddIf(null != __s ? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(__s, (__q) => __q?.ToJson(null, serializationMode)))) : null ,__r.Add); + } + container.Add("rows",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.PowerShell.cs new file mode 100644 index 000000000000..ed88e50061f7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.PowerShell.cs @@ -0,0 +1,226 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// Result of query. It contains all columns listed under groupings and aggregation. + /// + [System.ComponentModel.TypeConverter(typeof(QueryResultTypeConverter))] + public partial class QueryResult + { + + /// + /// 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.Cost.Models.Api20211001.IQueryResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryResult(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.Cost.Models.Api20211001.IQueryResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryResult(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.Cost.Models.Api20211001.IQueryResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryResult(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.Cost.Models.Api20211001.IQueryResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryColumnTypeConverter.ConvertFrom)); + } + if (content.Contains("Row")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueryResult(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.Cost.Models.Api20211001.IQueryResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).NextLink, global::System.Convert.ToString); + } + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Column = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Column, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryColumnTypeConverter.ConvertFrom)); + } + if (content.Contains("Row")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Row = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][]) content.GetValueForProperty("Row",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal)this).Row, __y => TypeConverterExtensions.SelectToArray(__y, __w => TypeConverterExtensions.SelectToArray(__w, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.AnyTypeConverter.ConvertFrom))); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of query. It contains all columns listed under groupings and aggregation. + [System.ComponentModel.TypeConverter(typeof(QueryResultTypeConverter))] + public partial interface IQueryResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.TypeConverter.cs new file mode 100644 index 000000000000..847f5cab0c86 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryResultTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.cs new file mode 100644 index 000000000000..079bdf59257d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.cs @@ -0,0 +1,157 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Result of query. It contains all columns listed under groupings and aggregation. + /// + public partial class QueryResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Resource(); + + /// Array of columns + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[] Column { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)Property).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)Property).Column = value ?? null /* arrayOf */; } + + /// ETag of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).ETag; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Id; } + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Location; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryProperties()); set { {_property = value;} } } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).ETag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Location = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Sku + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Sku = value; } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Tag = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Name; } + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string NextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)Property).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)Property).NextLink = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties _property; + + /// Query properties + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryProperties()); set => this._property = value; } + + /// Array of rows + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)Property).Row; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryPropertiesInternal)Property).Row = value ?? null /* arrayOf */; } + + /// SKU of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Sku; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Tag; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public QueryResult() + { + + } + + /// 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.Cost.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Result of query. It contains all columns listed under groupings and aggregation. + public partial interface IQueryResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource + { + /// Array of columns + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of columns", + SerializedName = @"columns", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[] Column { get; set; } + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The link (url) to the next page of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// Array of rows + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of rows", + SerializedName = @"rows", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get; set; } + + } + /// Result of query. It contains all columns listed under groupings and aggregation. + internal partial interface IQueryResultInternal : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal + { + /// Array of columns + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryColumn[] Column { get; set; } + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// Query properties + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryProperties Property { get; set; } + /// Array of rows + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[][] Row { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.json.cs new file mode 100644 index 000000000000..07838113d5dc --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryResult.json.cs @@ -0,0 +1,112 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Result of query. It contains all columns listed under groupings and aggregation. + /// + public partial class QueryResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryResult(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.PowerShell.cs new file mode 100644 index 000000000000..c7408d3e541c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The start and end date for pulling data for the query. + [System.ComponentModel.TypeConverter(typeof(QueryTimePeriodTypeConverter))] + public partial class QueryTimePeriod + { + + /// + /// 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.Cost.Models.Api20211001.IQueryTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueryTimePeriod(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.Cost.Models.Api20211001.IQueryTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueryTimePeriod(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.Cost.Models.Api20211001.IQueryTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueryTimePeriod(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueryTimePeriod(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The start and end date for pulling data for the query. + [System.ComponentModel.TypeConverter(typeof(QueryTimePeriodTypeConverter))] + public partial interface IQueryTimePeriod + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.TypeConverter.cs new file mode 100644 index 000000000000..566313bd1e32 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueryTimePeriodTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueryTimePeriod.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueryTimePeriod.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueryTimePeriod.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.cs new file mode 100644 index 000000000000..0dffe26022e6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The start and end date for pulling data for the query. + public partial class QueryTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriodInternal + { + + /// Backing field for property. + private global::System.DateTime _from; + + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime From { get => this._from; set => this._from = value; } + + /// Backing field for property. + private global::System.DateTime _to; + + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime To { get => this._to; set => this._to = value; } + + /// Creates an new instance. + public QueryTimePeriod() + { + + } + } + /// The start and end date for pulling data for the query. + public partial interface IQueryTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime From { get; set; } + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime To { get; set; } + + } + /// The start and end date for pulling data for the query. + internal partial interface IQueryTimePeriodInternal + + { + /// The start date to pull data from. + global::System.DateTime From { get; set; } + /// The end date to pull data to. + global::System.DateTime To { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.json.cs new file mode 100644 index 000000000000..fa76868fb4d3 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/QueryTimePeriod.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The start and end date for pulling data for the query. + public partial class QueryTimePeriod + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new QueryTimePeriod(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal QueryTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._from.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "from" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._to.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "to" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.PowerShell.cs new file mode 100644 index 000000000000..b48f5c1cf599 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The aggregation expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigAggregationTypeConverter))] + public partial class ReportConfigAggregation + { + + /// + /// 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.Cost.Models.Api20211001.IReportConfigAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigAggregation(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.Cost.Models.Api20211001.IReportConfigAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigAggregation(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.Cost.Models.Api20211001.IReportConfigAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigAggregation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Function")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal)this).Function, 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 ReportConfigAggregation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Function")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal)this).Function = (string) content.GetValueForProperty("Function",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal)this).Function, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The aggregation expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigAggregationTypeConverter))] + public partial interface IReportConfigAggregation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.TypeConverter.cs new file mode 100644 index 000000000000..efa68a832406 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigAggregationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigAggregation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigAggregation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigAggregation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.cs new file mode 100644 index 000000000000..bf7563f43473 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.cs @@ -0,0 +1,71 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The aggregation expression to be used in the report. + public partial class ReportConfigAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregation, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal + { + + /// Backing field for property. + private string _function= @"Sum"; + + /// The name of the aggregation function to use. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Function { get => this._function; } + + /// Internal Acessors for Function + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregationInternal.Function { get => this._function; set { {_function = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the column to aggregate. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ReportConfigAggregation() + { + + } + } + /// The aggregation expression to be used in the report. + public partial interface IReportConfigAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The name of the aggregation function to use. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The name of the aggregation function to use.", + SerializedName = @"function", + PossibleTypes = new [] { typeof(string) })] + string Function { get; } + /// The name of the column to aggregate. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the column to aggregate.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// The aggregation expression to be used in the report. + internal partial interface IReportConfigAggregationInternal + + { + /// The name of the aggregation function to use. + string Function { get; set; } + /// The name of the column to aggregate. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.json.cs new file mode 100644 index 000000000000..de9b398b8685 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigAggregation.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The aggregation expression to be used in the report. + public partial class ReportConfigAggregation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigAggregation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportConfigAggregation(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._function)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._function.ToString()) : null, "function" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.PowerShell.cs new file mode 100644 index 000000000000..9f9ad2087b99 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.PowerShell.cs @@ -0,0 +1,162 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The comparison expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigComparisonExpressionTypeConverter))] + public partial class ReportConfigComparisonExpression + { + + /// + /// 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.Cost.Models.Api20211001.IReportConfigComparisonExpression DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigComparisonExpression(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.Cost.Models.Api20211001.IReportConfigComparisonExpression DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigComparisonExpression(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.Cost.Models.Api20211001.IReportConfigComparisonExpression FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigComparisonExpression(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Value, __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 ReportConfigComparisonExpression(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)this).Value, __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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The comparison expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigComparisonExpressionTypeConverter))] + public partial interface IReportConfigComparisonExpression + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.TypeConverter.cs new file mode 100644 index 000000000000..db33d68c6ad5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigComparisonExpressionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigComparisonExpression.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigComparisonExpression.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigComparisonExpression.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.cs new file mode 100644 index 000000000000..70ef523fcb5c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.cs @@ -0,0 +1,85 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The comparison expression to be used in the report. + public partial class ReportConfigComparisonExpression : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal + { + + /// Backing field for property. + private string _name; + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType _operator; + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType Operator { get => this._operator; set => this._operator = value; } + + /// Backing field for property. + private string[] _value; + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ReportConfigComparisonExpression() + { + + } + } + /// The comparison expression to be used in the report. + public partial interface IReportConfigComparisonExpression : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType Operator { get; set; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// The comparison expression to be used in the report. + internal 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.Cost.Support.OperatorType Operator { get; set; } + /// Array of values to use for comparison + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.json.cs new file mode 100644 index 000000000000..85ccaf461f97 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigComparisonExpression.json.cs @@ -0,0 +1,120 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The comparison expression to be used in the report. + public partial class ReportConfigComparisonExpression + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigComparisonExpression(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportConfigComparisonExpression(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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.Cost.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.Cost.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._operator)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._operator.ToString()) : null, "operator" ,container.Add ); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.PowerShell.cs new file mode 100644 index 000000000000..f4cf5301b9a5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.PowerShell.cs @@ -0,0 +1,272 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The definition of data present in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigDatasetTypeConverter))] + public partial class ReportConfigDataset + { + + /// + /// 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.Cost.Models.Api20211001.IReportConfigDataset DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigDataset(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.Cost.Models.Api20211001.IReportConfigDataset DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigDataset(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.Cost.Models.Api20211001.IReportConfigDataset FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigDataset(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.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType.CreateFrom); + } + if (content.Contains("Aggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("Grouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("Sorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Sorting = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("Sorting",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Sorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)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 ReportConfigDataset(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.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Configuration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("Configuration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Configuration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Granularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Granularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType?) content.GetValueForProperty("Granularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Granularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType.CreateFrom); + } + if (content.Contains("Aggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Aggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("Aggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Aggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("Grouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Grouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("Sorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Sorting = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("Sorting",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).Sorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)this).TagValue, __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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The definition of data present in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigDatasetTypeConverter))] + public partial interface IReportConfigDataset + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.TypeConverter.cs new file mode 100644 index 000000000000..4ed33b558d0e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigDatasetTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigDataset.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigDataset.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigDataset.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.cs new file mode 100644 index 000000000000..e3b5775c05f9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of data present in the report. + public partial class ReportConfigDataset : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation Aggregation { get => (this._aggregation = this._aggregation ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetAggregation()); set => this._aggregation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfigurationInternal)Configuration).Column; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfigurationInternal)Configuration).Column = value ?? null /* arrayOf */; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).DimensionName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).DimensionOperator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType)""); } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).DimensionValue = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter _filter; + + /// Has filter expression to use in the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilter()); set => this._filter = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).And; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).And = value ?? null /* arrayOf */; } + + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).Or; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).Or = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType? _granularity; + + /// The granularity of rows in the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType? Granularity { get => this._granularity; set => this._granularity = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping[] _grouping; + + /// + /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping[] Grouping { get => this._grouping; set => this._grouping = value; } + + /// Internal Acessors for Configuration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal.Configuration { get => (this._configuration = this._configuration ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetConfiguration()); set { {_configuration = value;} } } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilter()); set { {_filter = value;} } } + + /// Internal Acessors for FilterDimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).Dimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).Dimension = value; } + + /// Internal Acessors for FilterTag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).Tag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[] _sorting; + + /// Array of order by expression to use in the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[] Sorting { get => this._sorting; set => this._sorting = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).TagName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).TagOperator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType)""); } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)Filter).TagValue = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public ReportConfigDataset() + { + + } + } + /// The definition of data present in the report. + public partial interface IReportConfigDataset : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IReportConfigDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DimensionName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? DimensionOperator { get; set; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] DimensionValue { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterAnd { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterOr { get; set; } + /// The granularity of rows in the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the report.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType? 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IReportConfigGrouping) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping[] Grouping { get; set; } + /// Array of order by expression to use in the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of order by expression to use in the report.", + SerializedName = @"sorting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[] Sorting { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? TagOperator { get; set; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + + } + /// The definition of data present in the report. + internal 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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; } + /// The name of the column to use in comparison. + string DimensionName { get; set; } + /// The operator to use for comparison. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? DimensionOperator { get; set; } + /// Array of values to use for comparison + string[] DimensionValue { get; set; } + /// Has filter expression to use in the report. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter Filter { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterAnd { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression FilterDimension { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterOr { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression FilterTag { get; set; } + /// The granularity of rows in the report. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType? 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.Cost.Models.Api20211001.IReportConfigGrouping[] Grouping { get; set; } + /// Array of order by expression to use in the report. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[] Sorting { get; set; } + /// The name of the column to use in comparison. + string TagName { get; set; } + /// The operator to use for comparison. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? TagOperator { get; set; } + /// Array of values to use for comparison + string[] TagValue { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.json.cs new file mode 100644 index 000000000000..ef7eb4fb92d0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDataset.json.cs @@ -0,0 +1,134 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of data present in the report. + public partial class ReportConfigDataset + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigDataset(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportConfigDataset(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_configuration = If( json?.PropertyT("configuration"), out var __jsonConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetConfiguration.FromJson(__jsonConfiguration) : Configuration;} + {_filter = If( json?.PropertyT("filter"), out var __jsonFilter) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilter.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.Cost.Models.Api20211001.ReportConfigDatasetAggregation.FromJson(__jsonAggregation) : Aggregation;} + {_grouping = If( json?.PropertyT("grouping"), out var __jsonGrouping) ? If( __jsonGrouping as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IReportConfigGrouping) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigGrouping.FromJson(__u) )) ))() : null : Grouping;} + {_sorting = If( json?.PropertyT("sorting"), out var __jsonSorting) ? If( __jsonSorting as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IReportConfigSorting) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigSorting.FromJson(__p) )) ))() : null : Sorting;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._configuration ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._configuration.ToJson(null,serializationMode) : null, "configuration" ,container.Add ); + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filter" ,container.Add ); + AddIf( null != (((object)this._granularity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._granularity.ToString()) : null, "granularity" ,container.Add ); + AddIf( null != this._aggregation ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._aggregation.ToJson(null,serializationMode) : null, "aggregation" ,container.Add ); + if (null != this._grouping) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._grouping ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("grouping",__w); + } + if (null != this._sorting) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __s in this._sorting ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("sorting",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.PowerShell.cs new file mode 100644 index 000000000000..bfb0a3a81a0d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.PowerShell.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(ReportConfigDatasetAggregationTypeConverter))] + public partial class ReportConfigDatasetAggregation + { + + /// + /// 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.Cost.Models.Api20211001.IReportConfigDatasetAggregation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigDatasetAggregation(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.Cost.Models.Api20211001.IReportConfigDatasetAggregation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigDatasetAggregation(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.Cost.Models.Api20211001.IReportConfigDatasetAggregation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigDatasetAggregation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReportConfigDatasetAggregation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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. + [System.ComponentModel.TypeConverter(typeof(ReportConfigDatasetAggregationTypeConverter))] + public partial interface IReportConfigDatasetAggregation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.TypeConverter.cs new file mode 100644 index 000000000000..4726ed5f84ba --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigDatasetAggregationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigDatasetAggregation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigDatasetAggregation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigDatasetAggregation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.cs new file mode 100644 index 000000000000..6a19898c7aa7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.cs @@ -0,0 +1,40 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class ReportConfigDatasetAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregationInternal + { + + /// Creates an new instance. + public ReportConfigDatasetAggregation() + { + + } + } + /// 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. + public partial interface IReportConfigDatasetAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray + { + + } + /// 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. + internal partial interface IReportConfigDatasetAggregationInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.dictionary.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.dictionary.cs new file mode 100644 index 000000000000..317d1cf46048 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.dictionary.cs @@ -0,0 +1,75 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class ReportConfigDatasetAggregation : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregation this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregation value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigAggregation value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetAggregation source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.json.cs new file mode 100644 index 000000000000..7a114c06f829 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetAggregation.json.cs @@ -0,0 +1,112 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class ReportConfigDatasetAggregation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigDatasetAggregation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ReportConfigDatasetAggregation(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigAggregation.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.PowerShell.cs new file mode 100644 index 000000000000..cd05b8465589 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.PowerShell.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The configuration of dataset in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigDatasetConfigurationTypeConverter))] + public partial class ReportConfigDatasetConfiguration + { + + /// + /// 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.Cost.Models.Api20211001.IReportConfigDatasetConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigDatasetConfiguration(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.Cost.Models.Api20211001.IReportConfigDatasetConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigDatasetConfiguration(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.Cost.Models.Api20211001.IReportConfigDatasetConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigDatasetConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfigurationInternal)this).Column, __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 ReportConfigDatasetConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfigurationInternal)this).Column = (string[]) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfigurationInternal)this).Column, __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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The configuration of dataset in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigDatasetConfigurationTypeConverter))] + public partial interface IReportConfigDatasetConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..5e904bf32cb7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.TypeConverter.cs @@ -0,0 +1,148 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigDatasetConfigurationTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigDatasetConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigDatasetConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigDatasetConfiguration.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.cs new file mode 100644 index 000000000000..4efe1b501454 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.cs @@ -0,0 +1,60 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The configuration of dataset in the report. + public partial class ReportConfigDatasetConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfigurationInternal + { + + /// Backing field for property. + private string[] _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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string[] Column { get => this._column; set => this._column = value; } + + /// Creates an new instance. + public ReportConfigDatasetConfiguration() + { + + } + } + /// The configuration of dataset in the report. + public partial interface IReportConfigDatasetConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + + } + /// The configuration of dataset in the report. + internal 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; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.json.cs new file mode 100644 index 000000000000..fc8db6b54e08 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDatasetConfiguration.json.cs @@ -0,0 +1,116 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The configuration of dataset in the report. + public partial class ReportConfigDatasetConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigDatasetConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportConfigDatasetConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_column = If( json?.PropertyT("columns"), out var __jsonColumns) ? If( __jsonColumns as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Column;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._column) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._column ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("columns",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.PowerShell.cs new file mode 100644 index 000000000000..4f9c51f539c2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.PowerShell.cs @@ -0,0 +1,328 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IReportConfigDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType.CreateFrom); + } + if (content.Contains("IncludeMonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment = (bool?) content.GetValueForProperty("IncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType.CreateFrom); + } + if (content.Contains("DataSetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetSorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetSorting = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)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 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.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("DataSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSet = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset) content.GetValueForProperty("DataSet",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSet, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetTypeConverter.ConvertFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Timeframe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).Timeframe = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType) content.GetValueForProperty("Timeframe",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).Timeframe, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType.CreateFrom); + } + if (content.Contains("IncludeMonetaryCommitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment = (bool?) content.GetValueForProperty("IncludeMonetaryCommitment",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).IncludeMonetaryCommitment, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimePeriodFrom")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodFrom = (global::System.DateTime) content.GetValueForProperty("TimePeriodFrom",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TimePeriodTo = (global::System.DateTime) content.GetValueForProperty("TimePeriodTo",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration) content.GetValueForProperty("DataSetConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetConfiguration, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetFilter = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) content.GetValueForProperty("DataSetFilter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGranularity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGranularity = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType?) content.GetValueForProperty("DataSetGranularity",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGranularity, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType.CreateFrom); + } + if (content.Contains("DataSetAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation) content.GetValueForProperty("DataSetAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetAggregation, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDatasetAggregationTypeConverter.ConvertFrom); + } + if (content.Contains("DataSetGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGrouping = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping[]) content.GetValueForProperty("DataSetGrouping",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetGrouping, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigGroupingTypeConverter.ConvertFrom)); + } + if (content.Contains("DataSetSorting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetSorting = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[]) content.GetValueForProperty("DataSetSorting",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DataSetSorting, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigSortingTypeConverter.ConvertFrom)); + } + if (content.Contains("ConfigurationColumn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).ConfigurationColumn = (string[]) content.GetValueForProperty("ConfigurationColumn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).ConfigurationColumn, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterDimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("FilterDimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterDimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterTag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("FilterTag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterTag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterAnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterAnd = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("FilterAnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterAnd, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("FilterOr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterOr = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("FilterOr",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).FilterOr, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal)this).TagValue, __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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.TypeConverter.cs new file mode 100644 index 000000000000..2026f9671d27 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigDefinitionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.cs new file mode 100644 index 000000000000..15450339261d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.cs @@ -0,0 +1,384 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a report config. + public partial class ReportConfigDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] ConfigurationColumn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).ConfigurationColumn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).ConfigurationColumn = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset _dataSet; + + /// Has definition for data in this report config. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Aggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Aggregation = value ?? null /* model class */; } + + /// The granularity of rows in the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType? DataSetGranularity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Granularity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Granularity = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType)""); } + + /// + /// Array of group by expression to use in the report. Report can have up to 2 group by clauses. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Grouping = value ?? null /* arrayOf */; } + + /// Array of order by expression to use in the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Sorting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Sorting = value ?? null /* arrayOf */; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).DimensionName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).DimensionName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).DimensionOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).DimensionOperator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType)""); } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).DimensionValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).DimensionValue = value ?? null /* arrayOf */; } + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterAnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).FilterAnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).FilterAnd = value ?? null /* arrayOf */; } + + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterOr { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).FilterOr; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).FilterOr = value ?? null /* arrayOf */; } + + /// Backing field for property. + private bool? _includeMonetaryCommitment; + + /// If true, report includes monetary commitment. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public bool? IncludeMonetaryCommitment { get => this._includeMonetaryCommitment; set => this._includeMonetaryCommitment = value; } + + /// Internal Acessors for DataSet + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDataset Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal.DataSet { get => (this._dataSet = this._dataSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDataset()); set { {_dataSet = value;} } } + + /// Internal Acessors for DataSetConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetConfiguration Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal.DataSetConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Configuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Configuration = value; } + + /// Internal Acessors for DataSetFilter + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal.DataSetFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).Filter = value; } + + /// Internal Acessors for FilterDimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal.FilterDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).FilterDimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).FilterDimension = value; } + + /// Internal Acessors for FilterTag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal.FilterTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).FilterTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).FilterTag = value; } + + /// Internal Acessors for TimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigTimePeriod()); set { {_timePeriod = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinitionInternal.Type { get => this._type; set { {_type = value;} } } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).TagName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).TagName = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).TagOperator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).TagOperator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType)""); } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).TagValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetInternal)DataSet).TagValue = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod _timePeriod; + + /// Has time period for pulling data for the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigTimePeriod()); set => this._timePeriod = value; } + + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodFrom { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriodInternal)TimePeriod).From; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriodInternal)TimePeriod).From = value ?? default(global::System.DateTime); } + + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? TimePeriodTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriodInternal)TimePeriod).To; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriodInternal)TimePeriod).To = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType _timeframe; + + /// + /// The time frame for pulling data for the report. If custom, then a specific time period must be provided. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType Timeframe { get => this._timeframe; set => this._timeframe = value; } + + /// Backing field for property. + private string _type= @"Usage"; + + /// + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ReportConfigDefinition() + { + + } + } + /// The definition of a report config. + public partial interface IReportConfigDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IReportConfigDatasetAggregation) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDatasetAggregation DataSetAggregation { get; set; } + /// The granularity of rows in the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the report.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType? 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IReportConfigGrouping) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get; set; } + /// Array of order by expression to use in the report. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of order by expression to use in the report.", + SerializedName = @"sorting", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DimensionName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? DimensionOperator { get; set; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] DimensionValue { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterAnd { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterOr { get; set; } + /// If true, report includes monetary commitment. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If true, report includes monetary commitment.", + SerializedName = @"includeMonetaryCommitment", + PossibleTypes = new [] { typeof(bool) })] + bool? IncludeMonetaryCommitment { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? TagOperator { get; set; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimePeriodTo { 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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.ReportTimeframeType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = 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) })] + string Type { get; } + + } + /// The definition of a report config. + internal 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; } + /// Has definition for data in this report config. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IReportConfigDatasetConfiguration DataSetConfiguration { get; set; } + /// Has filter expression to use in the report. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter DataSetFilter { get; set; } + /// The granularity of rows in the report. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType? 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.Cost.Models.Api20211001.IReportConfigGrouping[] DataSetGrouping { get; set; } + /// Array of order by expression to use in the report. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting[] DataSetSorting { get; set; } + /// The name of the column to use in comparison. + string DimensionName { get; set; } + /// The operator to use for comparison. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? DimensionOperator { get; set; } + /// Array of values to use for comparison + string[] DimensionValue { get; set; } + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterAnd { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression FilterDimension { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] FilterOr { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression FilterTag { get; set; } + /// If true, report includes monetary commitment. + bool? IncludeMonetaryCommitment { get; set; } + /// The name of the column to use in comparison. + string TagName { get; set; } + /// The operator to use for comparison. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? TagOperator { get; set; } + /// Array of values to use for comparison + string[] TagValue { get; set; } + /// Has time period for pulling data for the report. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod TimePeriod { get; set; } + /// The start date to pull data from. + global::System.DateTime? TimePeriodFrom { get; set; } + /// The end date to pull data to. + global::System.DateTime? TimePeriodTo { 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.Cost.Support.ReportTimeframeType 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. + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.json.cs new file mode 100644 index 000000000000..df726f24dff7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigDefinition.json.cs @@ -0,0 +1,116 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a report config. + public partial class ReportConfigDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigDefinition(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportConfigDefinition(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigTimePeriod.FromJson(__jsonTimePeriod) : TimePeriod;} + {_dataSet = If( json?.PropertyT("dataSet"), out var __jsonDataSet) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._timePeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._timePeriod.ToJson(null,serializationMode) : null, "timePeriod" ,container.Add ); + AddIf( null != this._dataSet ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._dataSet.ToJson(null,serializationMode) : null, "dataSet" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._timeframe)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._timeframe.ToString()) : null, "timeframe" ,container.Add ); + AddIf( null != this._includeMonetaryCommitment ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonBoolean((bool)this._includeMonetaryCommitment) : null, "includeMonetaryCommitment" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.PowerShell.cs new file mode 100644 index 000000000000..30277b43d01c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.PowerShell.cs @@ -0,0 +1,216 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The filter expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigFilterTypeConverter))] + public partial class ReportConfigFilter + { + + /// + /// 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.Cost.Models.Api20211001.IReportConfigFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigFilter(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.Cost.Models.Api20211001.IReportConfigFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigFilter(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.Cost.Models.Api20211001.IReportConfigFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("And")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("Or")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)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 ReportConfigFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Dimension, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpressionTypeConverter.ConvertFrom); + } + if (content.Contains("And")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).And = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("And",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).And, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("Or")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Or = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[]) content.GetValueForProperty("Or",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).Or, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilterTypeConverter.ConvertFrom)); + } + if (content.Contains("DimensionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionName, global::System.Convert.ToString); + } + if (content.Contains("DimensionOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("DimensionOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("DimensionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionValue = (string[]) content.GetValueForProperty("DimensionValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).DimensionValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TagName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagName = (string) content.GetValueForProperty("TagName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagName, global::System.Convert.ToString); + } + if (content.Contains("TagOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagOperator = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) content.GetValueForProperty("TagOperator",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagOperator, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType.CreateFrom); + } + if (content.Contains("TagValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagValue = (string[]) content.GetValueForProperty("TagValue",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal)this).TagValue, __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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The filter expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigFilterTypeConverter))] + public partial interface IReportConfigFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.TypeConverter.cs new file mode 100644 index 000000000000..c18c298c05d0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigFilterTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.cs new file mode 100644 index 000000000000..89de367282a7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.cs @@ -0,0 +1,176 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The filter expression to be used in the report. + public partial class ReportConfigFilter : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] _and; + + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] And { get => this._and; set => this._and = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression _dimension; + + /// Has comparison expression for a dimension + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpression()); set => this._dimension = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DimensionName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Dimension).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Dimension).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? DimensionOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Dimension).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Dimension).Operator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType)""); } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] DimensionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Dimension).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Dimension).Value = value ?? null /* arrayOf */; } + + /// Internal Acessors for Dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal.Dimension { get => (this._dimension = this._dimension ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpression()); set { {_dimension = value;} } } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilterInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpression()); set { {_tag = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] _or; + + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] Or { get => this._or; set => this._or = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression _tag; + + /// Has comparison expression for a tag + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpression()); set => this._tag = value; } + + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TagName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Tag).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Tag).Name = value ?? null; } + + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? TagOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Tag).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Tag).Operator = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType)""); } + + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string[] TagValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Tag).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpressionInternal)Tag).Value = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public ReportConfigFilter() + { + + } + } + /// The filter expression to be used in the report. + public partial interface IReportConfigFilter : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The logical "AND" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] And { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string DimensionName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? DimensionOperator { get; set; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] DimensionValue { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] Or { get; set; } + /// The name of the column to use in comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string TagName { get; set; } + /// The operator to use for comparison. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operator to use for comparison.", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? TagOperator { get; set; } + /// Array of values to use for comparison + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] TagValue { get; set; } + + } + /// The filter expression to be used in the report. + internal partial interface IReportConfigFilterInternal + + { + /// The logical "AND" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] And { get; set; } + /// Has comparison expression for a dimension + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Dimension { get; set; } + /// The name of the column to use in comparison. + string DimensionName { get; set; } + /// The operator to use for comparison. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? DimensionOperator { get; set; } + /// Array of values to use for comparison + string[] DimensionValue { get; set; } + /// The logical "OR" expression. Must have at least 2 items. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter[] Or { get; set; } + /// Has comparison expression for a tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigComparisonExpression Tag { get; set; } + /// The name of the column to use in comparison. + string TagName { get; set; } + /// The operator to use for comparison. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType? TagOperator { get; set; } + /// Array of values to use for comparison + string[] TagValue { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.json.cs new file mode 100644 index 000000000000..4e9ff1319ea6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigFilter.json.cs @@ -0,0 +1,130 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The filter expression to be used in the report. + public partial class ReportConfigFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportConfigFilter(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpression.FromJson(__jsonDimensions) : Dimension;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigComparisonExpression.FromJson(__jsonTags) : Tag;} + {_and = If( json?.PropertyT("and"), out var __jsonAnd) ? If( __jsonAnd as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IReportConfigFilter) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilter.FromJson(__u) )) ))() : null : And;} + {_or = If( json?.PropertyT("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IReportConfigFilter) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigFilter.FromJson(__p) )) ))() : null : Or;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._dimension ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._dimension.ToJson(null,serializationMode) : null, "dimensions" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + if (null != this._and) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._and ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("and",__w); + } + if (null != this._or) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __s in this._or ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("or",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.PowerShell.cs new file mode 100644 index 000000000000..0a26a5dac4ea --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The group by expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigGroupingTypeConverter))] + public partial class ReportConfigGrouping + { + + /// + /// 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.Cost.Models.Api20211001.IReportConfigGrouping DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigGrouping(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.Cost.Models.Api20211001.IReportConfigGrouping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigGrouping(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.Cost.Models.Api20211001.IReportConfigGrouping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigGrouping(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGroupingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGroupingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType.CreateFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGroupingInternal)this).Name, 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 ReportConfigGrouping(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGroupingInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGroupingInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType.CreateFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGroupingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGroupingInternal)this).Name, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The group by expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigGroupingTypeConverter))] + public partial interface IReportConfigGrouping + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.TypeConverter.cs new file mode 100644 index 000000000000..c090cc69ffd9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigGroupingTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigGrouping.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigGrouping.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigGrouping.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.cs new file mode 100644 index 000000000000..5b477108e8b5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.cs @@ -0,0 +1,74 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The group by expression to be used in the report. + public partial class ReportConfigGrouping : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGroupingInternal + { + + /// Backing field for property. + private string _name; + + /// + /// The name of the column to group. This version supports subscription lowest possible grain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType _type; + + /// Has type of the column to group. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ReportConfigGrouping() + { + + } + } + /// The group by expression to be used in the report. + public partial interface IReportConfigGrouping : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// The name of the column to group. This version supports subscription lowest possible grain. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the column to group. This version supports subscription lowest possible grain.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Has type of the column to group. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Has type of the column to group.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType Type { get; set; } + + } + /// The group by expression to be used in the report. + internal partial interface IReportConfigGroupingInternal + + { + /// + /// The name of the column to group. This version supports subscription lowest possible grain. + /// + string Name { get; set; } + /// Has type of the column to group. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.json.cs new file mode 100644 index 000000000000..5b8ff131a941 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigGrouping.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The group by expression to be used in the report. + public partial class ReportConfigGrouping + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigGrouping FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigGrouping(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportConfigGrouping(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.PowerShell.cs new file mode 100644 index 000000000000..e480f912da1d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The order by expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigSortingTypeConverter))] + public partial class ReportConfigSorting + { + + /// + /// 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.Cost.Models.Api20211001.IReportConfigSorting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigSorting(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.Cost.Models.Api20211001.IReportConfigSorting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigSorting(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.Cost.Models.Api20211001.IReportConfigSorting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigSorting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Direction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSortingInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSortingInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType.CreateFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSortingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSortingInternal)this).Name, 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 ReportConfigSorting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Direction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSortingInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSortingInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType.CreateFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSortingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSortingInternal)this).Name, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The order by expression to be used in the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigSortingTypeConverter))] + public partial interface IReportConfigSorting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.TypeConverter.cs new file mode 100644 index 000000000000..f4ef5a7ced49 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigSortingTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigSorting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigSorting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigSorting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.cs new file mode 100644 index 000000000000..52f3d29ea483 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The order by expression to be used in the report. + public partial class ReportConfigSorting : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSortingInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType? _direction; + + /// Direction of sort. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType? Direction { get => this._direction; set => this._direction = value; } + + /// Backing field for property. + private string _name; + + /// The name of the column to sort. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public ReportConfigSorting() + { + + } + } + /// The order by expression to be used in the report. + public partial interface IReportConfigSorting : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Direction of sort. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Direction of sort.", + SerializedName = @"direction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType? Direction { get; set; } + /// The name of the column to sort. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the column to sort.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// The order by expression to be used in the report. + internal partial interface IReportConfigSortingInternal + + { + /// Direction of sort. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType? Direction { get; set; } + /// The name of the column to sort. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.json.cs new file mode 100644 index 000000000000..f39f0e1a7059 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigSorting.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The order by expression to be used in the report. + public partial class ReportConfigSorting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigSorting FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigSorting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportConfigSorting(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._direction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._direction.ToString()) : null, "direction" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.PowerShell.cs new file mode 100644 index 000000000000..bb43dbcf45cb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The start and end date for pulling data for the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigTimePeriodTypeConverter))] + public partial class ReportConfigTimePeriod + { + + /// + /// 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.Cost.Models.Api20211001.IReportConfigTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportConfigTimePeriod(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.Cost.Models.Api20211001.IReportConfigTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportConfigTimePeriod(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.Cost.Models.Api20211001.IReportConfigTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportConfigTimePeriod(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReportConfigTimePeriod(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("From")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriodInternal)this).From = (global::System.DateTime) content.GetValueForProperty("From",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + if (content.Contains("To")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriodInternal)this).To = (global::System.DateTime) content.GetValueForProperty("To",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The start and end date for pulling data for the report. + [System.ComponentModel.TypeConverter(typeof(ReportConfigTimePeriodTypeConverter))] + public partial interface IReportConfigTimePeriod + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.TypeConverter.cs new file mode 100644 index 000000000000..130901e5d40a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportConfigTimePeriodTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportConfigTimePeriod.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportConfigTimePeriod.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportConfigTimePeriod.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.cs new file mode 100644 index 000000000000..4053f9701779 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The start and end date for pulling data for the report. + public partial class ReportConfigTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriodInternal + { + + /// Backing field for property. + private global::System.DateTime _from; + + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime From { get => this._from; set => this._from = value; } + + /// Backing field for property. + private global::System.DateTime _to; + + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime To { get => this._to; set => this._to = value; } + + /// Creates an new instance. + public ReportConfigTimePeriod() + { + + } + } + /// The start and end date for pulling data for the report. + public partial interface IReportConfigTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The start date to pull data from. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime From { get; set; } + /// The end date to pull data to. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime To { get; set; } + + } + /// The start and end date for pulling data for the report. + internal partial interface IReportConfigTimePeriodInternal + + { + /// The start date to pull data from. + global::System.DateTime From { get; set; } + /// The end date to pull data to. + global::System.DateTime To { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.json.cs new file mode 100644 index 000000000000..aec8cec44d99 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportConfigTimePeriod.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The start and end date for pulling data for the report. + public partial class ReportConfigTimePeriod + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportConfigTimePeriod(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportConfigTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._from.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "from" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._to.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "to" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.PowerShell.cs new file mode 100644 index 000000000000..37448021d084 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The URL to download the generated report. + [System.ComponentModel.TypeConverter(typeof(ReportUrlTypeConverter))] + public partial class ReportUrl + { + + /// + /// 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.Cost.Models.Api20211001.IReportUrl DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReportUrl(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.Cost.Models.Api20211001.IReportUrl DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReportUrl(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.Cost.Models.Api20211001.IReportUrl FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReportUrl(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ReportUrl1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)this).ReportUrl1 = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema?) content.GetValueForProperty("ReportUrl1",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)this).ReportUrl1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema.CreateFrom); + } + if (content.Contains("ValidUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReportUrl(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ReportUrl1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)this).ReportUrl1 = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema?) content.GetValueForProperty("ReportUrl1",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)this).ReportUrl1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema.CreateFrom); + } + if (content.Contains("ValidUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal)this).ValidUntil = (global::System.DateTime?) content.GetValueForProperty("ValidUntil",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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)); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The URL to download the generated report. + [System.ComponentModel.TypeConverter(typeof(ReportUrlTypeConverter))] + public partial interface IReportUrl + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.TypeConverter.cs new file mode 100644 index 000000000000..13814ce2eac2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportUrlTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportUrl.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportUrl.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportUrl.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.cs new file mode 100644 index 000000000000..7a096ec63564 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.cs @@ -0,0 +1,74 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The URL to download the generated report. + public partial class ReportUrl : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrlInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema? _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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema? ReportUrl1 { get => this._reportUrl1; set => this._reportUrl1 = value; } + + /// Backing field for property. + private global::System.DateTime? _validUntil; + + /// The time at which report URL becomes invalid. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? ValidUntil { get => this._validUntil; set => this._validUntil = value; } + + /// Creates an new instance. + public ReportUrl() + { + + } + } + /// The URL to download the generated report. + public partial interface IReportUrl : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// The CSV file from the reportUrl blob link consists of reservation usage data with the following schema at daily granularity + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Support.ReservationReportSchema) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema? ReportUrl1 { get; set; } + /// The time at which report URL becomes invalid. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time at which report URL becomes invalid.", + SerializedName = @"validUntil", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ValidUntil { get; set; } + + } + /// The URL to download the generated report. + internal 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.Cost.Support.ReservationReportSchema? ReportUrl1 { get; set; } + /// The time at which report URL becomes invalid. + global::System.DateTime? ValidUntil { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.json.cs new file mode 100644 index 000000000000..b6d50cc51039 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ReportUrl.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The URL to download the generated report. + public partial class ReportUrl + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportUrl FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportUrl(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportUrl(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._reportUrl1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._reportUrl1.ToString()) : null, "reportUrl" ,container.Add ); + AddIf( null != this._validUntil ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._validUntil?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "validUntil" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.PowerShell.cs new file mode 100644 index 000000000000..405f6d009983 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.PowerShell.cs @@ -0,0 +1,192 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The Resource model definition. + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial class Resource + { + + /// + /// 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.Cost.Models.Api20211001.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Resource(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.Cost.Models.Api20211001.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Resource(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.Cost.Models.Api20211001.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Resource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTagsTypeConverter.ConvertFrom); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Resource model definition. + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial interface IResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.TypeConverter.cs new file mode 100644 index 000000000000..ba1b0e55e72b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Resource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Resource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.cs new file mode 100644 index 000000000000..23433eb6fd0d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.cs @@ -0,0 +1,174 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The Resource model definition. + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal + { + + /// Backing field for property. + private string _eTag; + + /// ETag of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; } + + /// Backing field for property. + private string _id; + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Backing field for property. + private string _location; + + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Location { get => this._location; } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.ETag { get => this._eTag; set { {_eTag = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Sku + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Sku { get => this._sku; set { {_sku = value;} } } + + /// Internal Acessors for Tag + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTags()); set { {_tag = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _sku; + + /// SKU of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Sku { get => this._sku; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTags()); } + + /// Backing field for property. + private string _type; + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// The Resource model definition. + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// ETag of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ETag of the resource.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; } + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Id.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// Location of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Location of the resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; } + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// SKU of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"SKU of the resource.", + SerializedName = @"sku", + PossibleTypes = new [] { typeof(string) })] + string Sku { get; } + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Tag { get; } + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The Resource model definition. + internal partial interface IResourceInternal + + { + /// ETag of the resource. + string ETag { get; set; } + /// Resource Id. + string Id { get; set; } + /// Location of the resource. + string Location { get; set; } + /// Resource name. + string Name { get; set; } + /// SKU of the resource. + string Sku { get; set; } + /// Resource tags. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags Tag { get; set; } + /// Resource type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.json.cs new file mode 100644 index 000000000000..9737359411b5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Resource.json.cs @@ -0,0 +1,141 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The Resource model definition. + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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.Cost.Models.Api20211001.ResourceTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sku)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._sku.ToString()) : null, "sku" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._eTag.ToString()) : null, "eTag" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.PowerShell.cs new file mode 100644 index 000000000000..f358e0805032 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.PowerShell.cs @@ -0,0 +1,140 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(ResourceTagsTypeConverter))] + public partial class ResourceTags + { + + /// + /// 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.Cost.Models.Api20211001.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceTags(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.Cost.Models.Api20211001.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceTags(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.Cost.Models.Api20211001.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(ResourceTagsTypeConverter))] + public partial interface IResourceTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..83e4a8fa4e68 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTagsTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.cs new file mode 100644 index 000000000000..ad32d57a2769 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.cs @@ -0,0 +1,35 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Resource tags. + public partial class ResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTagsInternal + { + + /// Creates an new instance. + public ResourceTags() + { + + } + } + /// Resource tags. + public partial interface IResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface IResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.dictionary.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.dictionary.cs new file mode 100644 index 000000000000..9e170ddfa894 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.dictionary.cs @@ -0,0 +1,75 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class ResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.json.cs new file mode 100644 index 000000000000..77807d805b98 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ResourceTags.json.cs @@ -0,0 +1,109 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Resource tags. + public partial class ResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ResourceTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Status.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Status.PowerShell.cs new file mode 100644 index 000000000000..defbca113613 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Status.PowerShell.cs @@ -0,0 +1,144 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The status of the long running operation. + [System.ComponentModel.TypeConverter(typeof(StatusTypeConverter))] + public partial class Status + { + + /// + /// 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.Cost.Models.Api20211001.IStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Status(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.Cost.Models.Api20211001.IStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Status(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.Cost.Models.Api20211001.IStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Status(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatusInternal)this).Status1 = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType?) content.GetValueForProperty("Status1",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatusInternal)this).Status1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Status(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatusInternal)this).Status1 = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType?) content.GetValueForProperty("Status1",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatusInternal)this).Status1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType.CreateFrom); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The status of the long running operation. + [System.ComponentModel.TypeConverter(typeof(StatusTypeConverter))] + public partial interface IStatus + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Status.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Status.TypeConverter.cs new file mode 100644 index 000000000000..a6f95589cbb0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Status.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StatusTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Status.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Status.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Status.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/Status.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Status.cs new file mode 100644 index 000000000000..086b2ce69282 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Status.cs @@ -0,0 +1,51 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The status of the long running operation. + public partial class Status : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatusInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType? _status1; + + /// The status of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType? Status1 { get => this._status1; set => this._status1 = value; } + + /// Creates an new instance. + public Status() + { + + } + } + /// The status of the long running operation. + public partial interface IStatus : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The status of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status of the long running operation.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType? Status1 { get; set; } + + } + /// The status of the long running operation. + internal partial interface IStatusInternal + + { + /// The status of the long running operation. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType? Status1 { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/Status.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/Status.json.cs new file mode 100644 index 000000000000..9d91299da286 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/Status.json.cs @@ -0,0 +1,108 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The status of the long running operation. + public partial class Status + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new Status(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal Status(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status1 = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status1;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._status1.ToString()) : null, "status" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/View.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/View.PowerShell.cs new file mode 100644 index 000000000000..7a5ae6738462 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/View.PowerShell.cs @@ -0,0 +1,272 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IView FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Models.Api20211001.IViewInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IViewInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IViewInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).DateRange, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Chart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Chart = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType?) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Chart, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType.CreateFrom); + } + if (content.Contains("Accumulated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Accumulated = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType?) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Accumulated, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType.CreateFrom); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType.CreateFrom); + } + if (content.Contains("Kpi")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Kpi = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[]) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Kpi, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.KpiPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Pivot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Pivot = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[]) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Pivot, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.PivotPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Query")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDefinitionTypeConverter.ConvertFrom); + } + 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.Cost.Models.Api20211001.IViewInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IViewInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IViewInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).DateRange, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Chart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Chart = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType?) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Chart, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType.CreateFrom); + } + if (content.Contains("Accumulated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Accumulated = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType?) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Accumulated, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType.CreateFrom); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType.CreateFrom); + } + if (content.Contains("Kpi")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Kpi = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[]) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Kpi, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.KpiPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Pivot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Pivot = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[]) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Pivot, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.PivotPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Query")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDefinitionTypeConverter.ConvertFrom); + } + 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/swaggerci/cost-management/generated/api/Models/Api20211001/View.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/View.TypeConverter.cs new file mode 100644 index 000000000000..8caa34eaff10 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/View.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ViewTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return View.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return View.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return View.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/View.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/View.cs new file mode 100644 index 000000000000..7f513b42bd71 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/View.cs @@ -0,0 +1,303 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// States and configurations of Cost Analysis. + public partial class View : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ProxyResource(); + + /// Show costs accumulated over time. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType? Accumulated { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Accumulated; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Accumulated = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType)""); } + + /// Chart type of the main view in Cost Analysis. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType? Chart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Chart; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Chart = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType)""); } + + /// Date the user created this view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).CreatedOn; } + + /// Currency of the current view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Currency; } + + /// Date range of the current view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DateRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).DateRange; } + + /// User input name of the view. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).ETag = value ?? null; } + + /// Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; } + + /// List of KPIs to show in Cost Analysis UI. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[] Kpi { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Kpi; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Kpi = value ?? null /* arrayOf */; } + + /// Metric to use when displaying costs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType? Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Metric = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType)""); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type = value; } + + /// Internal Acessors for CreatedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).CreatedOn = value; } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal.Currency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Currency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Currency = value; } + + /// Internal Acessors for DateRange + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal.DateRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).DateRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).DateRange = value; } + + /// Internal Acessors for ModifiedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal.ModifiedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).ModifiedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).ModifiedOn = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewProperties()); set { {_property = value;} } } + + /// Date when the user last modified this view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public global::System.DateTime? ModifiedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).ModifiedOn; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Name; } + + /// Configuration of 3 sub-views in the Cost Analysis UI. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[] Pivot { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Pivot; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Pivot = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties _property; + + /// The properties of the view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewProperties()); set => this._property = value; } + + /// Query body configuration. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition Query { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Query; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Query = value ?? null /* model class */; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)Property).Scope = value ?? null; } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal)__proxyResource).Type; } + + /// 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.Cost.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + + /// Creates an new instance. + public View() + { + + } + } + /// States and configurations of Cost Analysis. + public partial interface IView : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResource + { + /// Show costs accumulated over time. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Show costs accumulated over time.", + SerializedName = @"accumulated", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType? Accumulated { get; set; } + /// Chart type of the main view in Cost Analysis. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Chart type of the main view in Cost Analysis. Required.", + SerializedName = @"chart", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType? Chart { get; set; } + /// Date the user created this view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date the user created this view.", + SerializedName = @"createdOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedOn { get; } + /// Currency of the current view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Currency of the current view.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// Date range of the current view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date range of the current view.", + SerializedName = @"dateRange", + PossibleTypes = new [] { typeof(string) })] + string DateRange { get; } + /// User input name of the view. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User input name of the view. Required.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// List of KPIs to show in Cost Analysis UI. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of KPIs to show in Cost Analysis UI.", + SerializedName = @"kpis", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[] Kpi { get; set; } + /// Metric to use when displaying costs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric to use when displaying costs.", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType? Metric { get; set; } + /// Date when the user last modified this view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date when the user last modified this view.", + SerializedName = @"modifiedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ModifiedOn { get; } + /// Configuration of 3 sub-views in the Cost Analysis UI. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Configuration of 3 sub-views in the Cost Analysis UI.", + SerializedName = @"pivots", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[] Pivot { get; set; } + /// Query body configuration. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query body configuration. Required.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition Query { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string Scope { get; set; } + + } + /// States and configurations of Cost Analysis. + internal partial interface IViewInternal : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IProxyResourceInternal + { + /// Show costs accumulated over time. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType? Accumulated { get; set; } + /// Chart type of the main view in Cost Analysis. Required. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType? Chart { get; set; } + /// Date the user created this view. + global::System.DateTime? CreatedOn { get; set; } + /// Currency of the current view. + string Currency { 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.Cost.Models.Api20211001.IKpiProperties[] Kpi { get; set; } + /// Metric to use when displaying costs. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType? 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.Cost.Models.Api20211001.IPivotProperties[] Pivot { get; set; } + /// The properties of the view. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties Property { get; set; } + /// Query body configuration. Required. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition Query { get; set; } + /// + /// 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. + /// + string Scope { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/View.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/View.json.cs new file mode 100644 index 000000000000..b1bf807db789 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/View.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// States and configurations of Cost Analysis. + public partial class View + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new View(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __proxyResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal View(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.PowerShell.cs new file mode 100644 index 000000000000..eae0ec3b7343 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// Result of listing views. It contains a list of available views. + [System.ComponentModel.TypeConverter(typeof(ViewListResultTypeConverter))] + public partial class ViewListResult + { + + /// + /// 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.Cost.Models.Api20211001.IViewListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ViewListResult(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.Cost.Models.Api20211001.IViewListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ViewListResult(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.Cost.Models.Api20211001.IViewListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ViewListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal)this).NextLink, 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 ViewListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ViewTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Result of listing views. It contains a list of available views. + [System.ComponentModel.TypeConverter(typeof(ViewListResultTypeConverter))] + public partial interface IViewListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.TypeConverter.cs new file mode 100644 index 000000000000..7902f43eb562 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ViewListResultTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ViewListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ViewListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ViewListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.cs new file mode 100644 index 000000000000..b47768ab6b5e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.cs @@ -0,0 +1,74 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Result of listing views. It contains a list of available views. + public partial class ViewListResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResult, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView[] Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView[] _value; + + /// The list of views. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView[] Value { get => this._value; } + + /// Creates an new instance. + public ViewListResult() + { + + } + } + /// Result of listing views. It contains a list of available views. + public partial interface IViewListResult : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The link (url) to the next page of results. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The link (url) to the next page of results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of views. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of views.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView[] Value { get; } + + } + /// Result of listing views. It contains a list of available views. + internal partial interface IViewListResultInternal + + { + /// The link (url) to the next page of results. + string NextLink { get; set; } + /// The list of views. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.json.cs new file mode 100644 index 000000000000..f61c99fa9a69 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewListResult.json.cs @@ -0,0 +1,124 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// Result of listing views. It contains a list of available views. + public partial class ViewListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ViewListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ViewListResult(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IView) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.PowerShell.cs new file mode 100644 index 000000000000..0e12407d78bb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.PowerShell.cs @@ -0,0 +1,232 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20211001.IViewProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IViewPropertiesInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IViewPropertiesInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).DateRange, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Chart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Chart = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType?) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Chart, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType.CreateFrom); + } + if (content.Contains("Accumulated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Accumulated = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType?) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Accumulated, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType.CreateFrom); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType.CreateFrom); + } + if (content.Contains("Kpi")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Kpi = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[]) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Kpi, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.KpiPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Pivot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Pivot = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[]) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Pivot, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.PivotPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Query")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDefinitionTypeConverter.ConvertFrom); + } + 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("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IViewPropertiesInternal)this).ModifiedOn = (global::System.DateTime?) content.GetValueForProperty("ModifiedOn",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IViewPropertiesInternal)this).DateRange = (string) content.GetValueForProperty("DateRange",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).DateRange, global::System.Convert.ToString); + } + if (content.Contains("Currency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Currency = (string) content.GetValueForProperty("Currency",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Currency, global::System.Convert.ToString); + } + if (content.Contains("Chart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Chart = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType?) content.GetValueForProperty("Chart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Chart, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType.CreateFrom); + } + if (content.Contains("Accumulated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Accumulated = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType?) content.GetValueForProperty("Accumulated",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Accumulated, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType.CreateFrom); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType.CreateFrom); + } + if (content.Contains("Kpi")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Kpi = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[]) content.GetValueForProperty("Kpi",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Kpi, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.KpiPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Pivot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Pivot = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[]) content.GetValueForProperty("Pivot",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Pivot, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.PivotPropertiesTypeConverter.ConvertFrom)); + } + if (content.Contains("Query")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Query = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal)this).Query, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDefinitionTypeConverter.ConvertFrom); + } + 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/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.TypeConverter.cs new file mode 100644 index 000000000000..4c4454356e82 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20211001 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ViewPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ViewProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ViewProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ViewProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.cs new file mode 100644 index 000000000000..0b8fe27e2611 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.cs @@ -0,0 +1,280 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The properties of the view. + public partial class ViewProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType? _accumulated; + + /// Show costs accumulated over time. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType? Accumulated { get => this._accumulated; set => this._accumulated = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType? _chart; + + /// Chart type of the main view in Cost Analysis. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType? Chart { get => this._chart; set => this._chart = value; } + + /// Backing field for property. + private global::System.DateTime? _createdOn; + + /// Date the user created this view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedOn { get => this._createdOn; } + + /// Backing field for property. + private string _currency; + + /// Currency of the current view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Currency { get => this._currency; } + + /// Backing field for property. + private string _dateRange; + + /// Date range of the current view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string DateRange { get => this._dateRange; } + + /// Backing field for property. + private string _displayName; + + /// User input name of the view. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[] _kpi; + + /// List of KPIs to show in Cost Analysis UI. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[] Kpi { get => this._kpi; set => this._kpi = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType? _metric; + + /// Metric to use when displaying costs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType? Metric { get => this._metric; set => this._metric = value; } + + /// Internal Acessors for CreatedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + + /// Internal Acessors for Currency + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal.Currency { get => this._currency; set { {_currency = value;} } } + + /// Internal Acessors for DateRange + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal.DateRange { get => this._dateRange; set { {_dateRange = value;} } } + + /// Internal Acessors for ModifiedOn + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewPropertiesInternal.ModifiedOn { get => this._modifiedOn; set { {_modifiedOn = value;} } } + + /// Backing field for property. + private global::System.DateTime? _modifiedOn; + + /// Date when the user last modified this view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? ModifiedOn { get => this._modifiedOn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[] _pivot; + + /// Configuration of 3 sub-views in the Cost Analysis UI. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[] Pivot { get => this._pivot; set => this._pivot = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition _query; + + /// Query body configuration. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition Query { get => (this._query = this._query ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDefinition()); set => this._query = value; } + + /// Backing field for property. + private string _scope; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Creates an new instance. + public ViewProperties() + { + + } + } + /// The properties of the view. + public partial interface IViewProperties : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Show costs accumulated over time. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Show costs accumulated over time.", + SerializedName = @"accumulated", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType? Accumulated { get; set; } + /// Chart type of the main view in Cost Analysis. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Chart type of the main view in Cost Analysis. Required.", + SerializedName = @"chart", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType? Chart { get; set; } + /// Date the user created this view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date the user created this view.", + SerializedName = @"createdOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedOn { get; } + /// Currency of the current view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Currency of the current view.", + SerializedName = @"currency", + PossibleTypes = new [] { typeof(string) })] + string Currency { get; } + /// Date range of the current view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date range of the current view.", + SerializedName = @"dateRange", + PossibleTypes = new [] { typeof(string) })] + string DateRange { get; } + /// User input name of the view. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User input name of the view. Required.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// List of KPIs to show in Cost Analysis UI. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of KPIs to show in Cost Analysis UI.", + SerializedName = @"kpis", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[] Kpi { get; set; } + /// Metric to use when displaying costs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric to use when displaying costs.", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType? Metric { get; set; } + /// Date when the user last modified this view. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Date when the user last modified this view.", + SerializedName = @"modifiedOn", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ModifiedOn { get; } + /// Configuration of 3 sub-views in the Cost Analysis UI. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Configuration of 3 sub-views in the Cost Analysis UI.", + SerializedName = @"pivots", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[] Pivot { get; set; } + /// Query body configuration. Required. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query body configuration. Required.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition Query { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string Scope { get; set; } + + } + /// The properties of the view. + internal partial interface IViewPropertiesInternal + + { + /// Show costs accumulated over time. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType? Accumulated { get; set; } + /// Chart type of the main view in Cost Analysis. Required. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType? Chart { get; set; } + /// Date the user created this view. + global::System.DateTime? CreatedOn { get; set; } + /// Currency of the current view. + string Currency { 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.Cost.Models.Api20211001.IKpiProperties[] Kpi { get; set; } + /// Metric to use when displaying costs. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType? 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.Cost.Models.Api20211001.IPivotProperties[] Pivot { get; set; } + /// Query body configuration. Required. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition Query { get; set; } + /// + /// 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. + /// + string Scope { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.json.cs b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.json.cs new file mode 100644 index 000000000000..f41bf5db3198 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20211001/ViewProperties.json.cs @@ -0,0 +1,158 @@ +// 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.Cost.Models.Api20211001 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The properties of the view. + public partial class ViewProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IViewProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ViewProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._createdOn ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._modifiedOn ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._dateRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._dateRange.ToString()) : null, "dateRange" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currency)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._currency.ToString()) : null, "currency" ,container.Add ); + } + AddIf( null != (((object)this._chart)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._chart.ToString()) : null, "chart" ,container.Add ); + AddIf( null != (((object)this._accumulated)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._accumulated.ToString()) : null, "accumulated" ,container.Add ); + AddIf( null != (((object)this._metric)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._metric.ToString()) : null, "metric" ,container.Add ); + if (null != this._kpi) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._kpi ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("kpis",__w); + } + if (null != this._pivot) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __s in this._pivot ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("pivots",__r); + } + AddIf( null != this._query ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._query.ToJson(null,serializationMode) : null, "query" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ViewProperties(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_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.Cost.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.Cost.Models.Api20211001.IKpiProperties) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.KpiProperties.FromJson(__u) )) ))() : null : Kpi;} + {_pivot = If( json?.PropertyT("pivots"), out var __jsonPivots) ? If( __jsonPivots as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IPivotProperties) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.PivotProperties.FromJson(__p) )) ))() : null : Pivot;} + {_query = If( json?.PropertyT("query"), out var __jsonQuery) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ReportConfigDefinition.FromJson(__jsonQuery) : Query;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.PowerShell.cs new file mode 100644 index 000000000000..4773f14dfdf6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.PowerShell.cs @@ -0,0 +1,152 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The blob information generated by this operation. + [System.ComponentModel.TypeConverter(typeof(BlobInfoTypeConverter))] + public partial class BlobInfo + { + + /// + /// 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 BlobInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BlobLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfoInternal)this).BlobLink = (string) content.GetValueForProperty("BlobLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfoInternal)this).BlobLink, global::System.Convert.ToString); + } + if (content.Contains("ByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfoInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfoInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BlobLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfoInternal)this).BlobLink = (string) content.GetValueForProperty("BlobLink",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfoInternal)this).BlobLink, global::System.Convert.ToString); + } + if (content.Contains("ByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfoInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfoInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.Cost.Models.Api20220501.IBlobInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobInfo(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.Cost.Models.Api20220501.IBlobInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobInfo(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.Cost.Models.Api20220501.IBlobInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The blob information generated by this operation. + [System.ComponentModel.TypeConverter(typeof(BlobInfoTypeConverter))] + public partial interface IBlobInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.TypeConverter.cs new file mode 100644 index 000000000000..564437c2397d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.TypeConverter.cs @@ -0,0 +1,146 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobInfoTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.cs new file mode 100644 index 000000000000..f772956d1734 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.cs @@ -0,0 +1,68 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The blob information generated by this operation. + public partial class BlobInfo : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfoInternal + { + + /// Backing field for property. + private string _blobLink; + + /// Link to the blob to download file. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string BlobLink { get => this._blobLink; set => this._blobLink = value; } + + /// Backing field for property. + private long? _byteCount; + + /// Bytes in the blob. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public long? ByteCount { get => this._byteCount; set => this._byteCount = value; } + + /// Creates an new instance. + public BlobInfo() + { + + } + } + /// The blob information generated by this operation. + public partial interface IBlobInfo : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Link to the blob to download file. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Link to the blob to download file.", + SerializedName = @"blobLink", + PossibleTypes = new [] { typeof(string) })] + string BlobLink { get; set; } + /// Bytes in the blob. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Bytes in the blob.", + SerializedName = @"byteCount", + PossibleTypes = new [] { typeof(long) })] + long? ByteCount { get; set; } + + } + /// The blob information generated by this operation. + internal partial interface IBlobInfoInternal + + { + /// Link to the blob to download file. + string BlobLink { get; set; } + /// Bytes in the blob. + long? ByteCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.json.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.json.cs new file mode 100644 index 000000000000..13fb641f79c4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/BlobInfo.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The blob information generated by this operation. + public partial class BlobInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal BlobInfo(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_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.Cost.Models.Api20220501.IBlobInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new BlobInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._blobLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._blobLink.ToString()) : null, "blobLink" ,container.Add ); + AddIf( null != this._byteCount ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNumber((long)this._byteCount) : null, "byteCount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.PowerShell.cs new file mode 100644 index 000000000000..7fe6b10daf57 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.PowerShell.cs @@ -0,0 +1,328 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Manifest = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest) content.GetValueForProperty("Manifest",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Manifest, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ReportManifestTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType.CreateFrom); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestRequestContext = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext) content.GetValueForProperty("ManifestRequestContext",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestRequestContext, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.RequestContextTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestVersion, global::System.Convert.ToString); + } + if (content.Contains("ManifestDataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestDataFormat = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat?) content.GetValueForProperty("ManifestDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestDataFormat, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat.CreateFrom); + } + if (content.Contains("ManifestByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestByteCount = (long?) content.GetValueForProperty("ManifestByteCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ManifestBlobCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlobCount = (int?) content.GetValueForProperty("ManifestBlobCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManifestCompressData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestCompressData = (bool?) content.GetValueForProperty("ManifestCompressData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestCompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ManifestBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlob = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[]) content.GetValueForProperty("ManifestBlob",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlob, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.BlobInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestContextRequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope, global::System.Convert.ToString); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("RequestContextRequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType.CreateFrom); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Manifest = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest) content.GetValueForProperty("Manifest",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Manifest, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ReportManifestTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType.CreateFrom); + } + if (content.Contains("ValidTill")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ValidTill = (global::System.DateTime?) content.GetValueForProperty("ValidTill",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestRequestContext = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext) content.GetValueForProperty("ManifestRequestContext",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestRequestContext, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.RequestContextTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestVersion, global::System.Convert.ToString); + } + if (content.Contains("ManifestDataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestDataFormat = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat?) content.GetValueForProperty("ManifestDataFormat",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestDataFormat, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat.CreateFrom); + } + if (content.Contains("ManifestByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestByteCount = (long?) content.GetValueForProperty("ManifestByteCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ManifestBlobCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlobCount = (int?) content.GetValueForProperty("ManifestBlobCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManifestCompressData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestCompressData = (bool?) content.GetValueForProperty("ManifestCompressData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestCompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ManifestBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlob = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[]) content.GetValueForProperty("ManifestBlob",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).ManifestBlob, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.BlobInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestContextRequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestScope, global::System.Convert.ToString); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("RequestContextRequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType.CreateFrom); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20220501.ICostDetailsOperationResults FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.TypeConverter.cs new file mode 100644 index 000000000000..1679ea2083c9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CostDetailsOperationResultsTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CostDetailsOperationResults.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CostDetailsOperationResults.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CostDetailsOperationResults.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.cs new file mode 100644 index 000000000000..f9d1b7db5601 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.cs @@ -0,0 +1,398 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The result of the long running operation for cost details Api. + public partial class CostDetailsOperationResults : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails _error; + + /// The details of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set => this._error = value; } + + /// Backing field for property. + private string _id; + + /// The id of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest _manifest; + + /// The manifest of the report generated by the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest Manifest { get => (this._manifest = this._manifest ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ReportManifest()); set => this._manifest = value; } + + /// List of blob information generated by this operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[] ManifestBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).Blob = value ?? null /* arrayOf */; } + + /// The total number of blobs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public int? ManifestBlobCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).BlobCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).BlobCount = value ?? default(int); } + + /// The total number of bytes in all blobs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public long? ManifestByteCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).ByteCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).ByteCount = value ?? default(long); } + + /// Is the data in compressed format. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public bool? ManifestCompressData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).CompressData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).CompressData = value ?? default(bool); } + + /// The data format of the report + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat? ManifestDataFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).DataFormat; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).DataFormat = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat)""); } + + /// The Manifest version. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string ManifestVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).ManifestVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).ManifestVersion = value ?? null; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for Manifest + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal.Manifest { get => (this._manifest = this._manifest ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ReportManifest()); set { {_manifest = value;} } } + + /// Internal Acessors for ManifestRequestContext + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal.ManifestRequestContext { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestContext; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestContext = value; } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + + /// Internal Acessors for RequestBodyTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal.RequestBodyTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyTimePeriod = value; } + + /// Internal Acessors for RequestContextRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResultsInternal.RequestContextRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestContextRequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestContextRequestBody = value; } + + /// Backing field for property. + private string _name; + + /// The name of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string RequestBodyBillingPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyBillingPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.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 + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string RequestBodyInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyInvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyInvoiceId = value ?? null; } + + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? RequestBodyMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestBodyMetric = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType)""); } + + /// The request scope of the request. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string RequestContextRequestScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestContextRequestScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).RequestContextRequestScope = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType? _status; + + /// The status of the cost details operation + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType? Status { get => this._status; set => this._status = value; } + + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).TimePeriodEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).TimePeriodEnd = value ?? null; } + + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).TimePeriodStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)Manifest).TimePeriodStart = value ?? null; } + + /// Backing field for property. + private string _type; + + /// The type of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private global::System.DateTime? _validTill; + + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public global::System.DateTime? ValidTill { get => this._validTill; set => this._validTill = value; } + + /// Creates an new instance. + public CostDetailsOperationResults() + { + + } + } + /// The result of the long running operation for cost details Api. + public partial interface ICostDetailsOperationResults : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The id of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The id of the long running operation.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// List of blob information generated by this operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of blob information generated by this operation.", + SerializedName = @"blobs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[] ManifestBlob { get; set; } + /// The total number of blobs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total number of blobs.", + SerializedName = @"blobCount", + PossibleTypes = new [] { typeof(int) })] + int? ManifestBlobCount { get; set; } + /// The total number of bytes in all blobs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total number of bytes in all blobs.", + SerializedName = @"byteCount", + PossibleTypes = new [] { typeof(long) })] + long? ManifestByteCount { get; set; } + /// Is the data in compressed format. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Is the data in compressed format.", + SerializedName = @"compressData", + PossibleTypes = new [] { typeof(bool) })] + bool? ManifestCompressData { get; set; } + /// The data format of the report + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data format of the report", + SerializedName = @"dataFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat? ManifestDataFormat { get; set; } + /// The Manifest version. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Manifest version.", + SerializedName = @"manifestVersion", + PossibleTypes = new [] { typeof(string) })] + string ManifestVersion { get; set; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The name of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the long running operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { 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 + /// is not provided in the request body the API will return the current month's cost. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string RequestBodyBillingPeriod { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string RequestBodyInvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the detailed report. By default ActualCost is provided", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? RequestBodyMetric { get; set; } + /// The request scope of the request. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request scope of the request.", + SerializedName = @"requestScope", + PossibleTypes = new [] { typeof(string) })] + string RequestContextRequestScope { get; set; } + /// The status of the cost details operation + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status of the cost details operation", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType? Status { get; set; } + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to. example format 2020-03-15", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodEnd { get; set; } + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from. example format 2020-03-15", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodStart { get; set; } + /// The type of the long running operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the long running operation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + global::System.DateTime? ValidTill { get; set; } + + } + /// The result of the long running operation for cost details Api. + internal partial interface ICostDetailsOperationResultsInternal + + { + /// Error code. + string Code { get; set; } + /// The details of the error. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.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.Cost.Models.Api20220501.IReportManifest Manifest { get; set; } + /// List of blob information generated by this operation. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[] ManifestBlob { get; set; } + /// The total number of blobs. + int? ManifestBlobCount { get; set; } + /// The total number of bytes in all blobs. + long? ManifestByteCount { get; set; } + /// Is the data in compressed format. + bool? ManifestCompressData { get; set; } + /// The data format of the report + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat? ManifestDataFormat { get; set; } + /// The context of the Cost Details request. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext ManifestRequestContext { get; set; } + /// The Manifest version. + string ManifestVersion { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + /// The name of the long running operation. + string Name { 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 + /// is not provided in the request body the API will return the current month's cost. + /// + string RequestBodyBillingPeriod { get; set; } + /// + /// 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. + /// + string RequestBodyInvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? 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.Cost.Models.Api20220501.ICostDetailsTimePeriod RequestBodyTimePeriod { get; set; } + /// The request payload body provided in Cost Details call + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.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.Cost.Support.CostDetailsStatusType? 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 + string TimePeriodStart { get; set; } + /// The type of the long running operation. + string Type { get; set; } + /// + /// The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. + /// + global::System.DateTime? ValidTill { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.json.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.json.cs new file mode 100644 index 000000000000..bf70bc1f2267 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsOperationResults.json.cs @@ -0,0 +1,120 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The result of the long running operation for cost details Api. + public partial class CostDetailsOperationResults + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal CostDetailsOperationResults(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_manifest = If( json?.PropertyT("manifest"), out var __jsonManifest) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ReportManifest.FromJson(__jsonManifest) : Manifest;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new CostDetailsOperationResults(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._manifest ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._manifest.ToJson(null,serializationMode) : null, "manifest" ,container.Add ); + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._validTill ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._validTill?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "validTill" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.PowerShell.cs new file mode 100644 index 000000000000..d400f9510555 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.PowerShell.cs @@ -0,0 +1,156 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(CostDetailsTimePeriodTypeConverter))] + public partial class CostDetailsTimePeriod + { + + /// + /// 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 CostDetailsTimePeriod(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)this).Start, global::System.Convert.ToString); + } + if (content.Contains("End")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)this).End = (string) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)this).End, 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 CostDetailsTimePeriod(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)this).Start = (string) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)this).Start, global::System.Convert.ToString); + } + if (content.Contains("End")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)this).End = (string) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)this).End, 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.Cost.Models.Api20220501.ICostDetailsTimePeriod DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CostDetailsTimePeriod(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.Cost.Models.Api20220501.ICostDetailsTimePeriod DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CostDetailsTimePeriod(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.Cost.Models.Api20220501.ICostDetailsTimePeriod FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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. + [System.ComponentModel.TypeConverter(typeof(CostDetailsTimePeriodTypeConverter))] + public partial interface ICostDetailsTimePeriod + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.TypeConverter.cs new file mode 100644 index 000000000000..883d4b59cb6f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CostDetailsTimePeriodTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CostDetailsTimePeriod.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CostDetailsTimePeriod.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CostDetailsTimePeriod.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.cs new file mode 100644 index 000000000000..146aeababb79 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.cs @@ -0,0 +1,73 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class CostDetailsTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal + { + + /// Backing field for property. + private string _end; + + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string End { get => this._end; set => this._end = value; } + + /// Backing field for property. + private string _start; + + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Start { get => this._start; set => this._start = value; } + + /// Creates an new instance. + public CostDetailsTimePeriod() + { + + } + } + /// 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. + public partial interface ICostDetailsTimePeriod : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The end date to pull data to. example format 2020-03-15", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + string End { get; set; } + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date to pull data from. example format 2020-03-15", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + string Start { get; set; } + + } + /// 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. + internal partial interface ICostDetailsTimePeriodInternal + + { + /// The end date to pull data to. example format 2020-03-15 + string End { get; set; } + /// The start date to pull data from. example format 2020-03-15 + string Start { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.json.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.json.cs new file mode 100644 index 000000000000..081384d7a31c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/CostDetailsTimePeriod.json.cs @@ -0,0 +1,113 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// 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. + /// + public partial class CostDetailsTimePeriod + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal CostDetailsTimePeriod(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + 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;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new CostDetailsTimePeriod(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._start)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._start.ToString()) : null, "start" ,container.Add ); + AddIf( null != (((object)this._end)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._end.ToString()) : null, "end" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..2015429bf384 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.PowerShell.cs @@ -0,0 +1,189 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 400 Bad Request - Invalid Request Payload. Request payload provided is not in a json format or had an invalid member + /// not accepted in the request payload. + /// * 400 Bad Request - Invalid request payload: can only have either timePeriod or invoiceId or billingPeriod. API only allows + /// data to be pulled for either timePeriod or invoiceId or billingPeriod. Customer should provide only one of these parameters. + /// * 400 Bad Request - Start date must be after . API only allows data to be pulled no older than 13 months from now. + /// * 400 Bad Request - The maximum allowed date range is 1 months. API only allows data to be pulled for 1 month or less. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "retry-after" header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + /// + [System.ComponentModel.TypeConverter(typeof(GenerateCostDetailsReportErrorResponseTypeConverter))] + public partial class GenerateCostDetailsReportErrorResponse + { + + /// + /// 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.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateCostDetailsReportErrorResponse(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.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateCostDetailsReportErrorResponse(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.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateCostDetailsReportErrorResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Message, 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 GenerateCostDetailsReportErrorResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal)this).Message, 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 400 Bad Request - Invalid Request Payload. Request payload provided is not in a json format or had an invalid member + /// not accepted in the request payload. + /// * 400 Bad Request - Invalid request payload: can only have either timePeriod or invoiceId or billingPeriod. API only allows + /// data to be pulled for either timePeriod or invoiceId or billingPeriod. Customer should provide only one of these parameters. + /// * 400 Bad Request - Start date must be after . API only allows data to be pulled no older than 13 months from now. + /// * 400 Bad Request - The maximum allowed date range is 1 months. API only allows data to be pulled for 1 month or less. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "retry-after" header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + [System.ComponentModel.TypeConverter(typeof(GenerateCostDetailsReportErrorResponseTypeConverter))] + public partial interface IGenerateCostDetailsReportErrorResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..a84d0da878d2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.TypeConverter.cs @@ -0,0 +1,151 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateCostDetailsReportErrorResponseTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateCostDetailsReportErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateCostDetailsReportErrorResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateCostDetailsReportErrorResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.cs new file mode 100644 index 000000000000..a510a116695e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.cs @@ -0,0 +1,115 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 400 Bad Request - Invalid Request Payload. Request payload provided is not in a json format or had an invalid member + /// not accepted in the request payload. + /// * 400 Bad Request - Invalid request payload: can only have either timePeriod or invoiceId or billingPeriod. API only allows + /// data to be pulled for either timePeriod or invoiceId or billingPeriod. Customer should provide only one of these parameters. + /// * 400 Bad Request - Start date must be after . API only allows data to be pulled no older than 13 months from now. + /// * 400 Bad Request - The maximum allowed date range is 1 months. API only allows data to be pulled for 1 month or less. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "retry-after" header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + /// + public partial class GenerateCostDetailsReportErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal + { + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails _error; + + /// The details of the error. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set => this._error = value; } + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Code = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetailsInternal)Error).Message = value; } + + /// Creates an new instance. + public GenerateCostDetailsReportErrorResponse() + { + + } + } + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 400 Bad Request - Invalid Request Payload. Request payload provided is not in a json format or had an invalid member + /// not accepted in the request payload. + /// * 400 Bad Request - Invalid request payload: can only have either timePeriod or invoiceId or billingPeriod. API only allows + /// data to be pulled for either timePeriod or invoiceId or billingPeriod. Customer should provide only one of these parameters. + /// * 400 Bad Request - Start date must be after . API only allows data to be pulled no older than 13 months from now. + /// * 400 Bad Request - The maximum allowed date range is 1 months. API only allows data to be pulled for 1 month or less. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "retry-after" header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + public partial interface IGenerateCostDetailsReportErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Error message indicating why the operation failed.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + + } + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 400 Bad Request - Invalid Request Payload. Request payload provided is not in a json format or had an invalid member + /// not accepted in the request payload. + /// * 400 Bad Request - Invalid request payload: can only have either timePeriod or invoiceId or billingPeriod. API only allows + /// data to be pulled for either timePeriod or invoiceId or billingPeriod. Customer should provide only one of these parameters. + /// * 400 Bad Request - Start date must be after . API only allows data to be pulled no older than 13 months from now. + /// * 400 Bad Request - The maximum allowed date range is 1 months. API only allows data to be pulled for 1 month or less. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "retry-after" header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + internal partial interface IGenerateCostDetailsReportErrorResponseInternal + + { + /// Error code. + string Code { get; set; } + /// The details of the error. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IErrorDetails Error { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.json.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.json.cs new file mode 100644 index 000000000000..b185ff4eaaec --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportErrorResponse.json.cs @@ -0,0 +1,122 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// + /// Error response indicates that the service is not able to process the incoming request. The reason is provided in the error + /// message. + /// Some Error responses: + /// * 400 Bad Request - Invalid Request Payload. Request payload provided is not in a json format or had an invalid member + /// not accepted in the request payload. + /// * 400 Bad Request - Invalid request payload: can only have either timePeriod or invoiceId or billingPeriod. API only allows + /// data to be pulled for either timePeriod or invoiceId or billingPeriod. Customer should provide only one of these parameters. + /// * 400 Bad Request - Start date must be after . API only allows data to be pulled no older than 13 months from now. + /// * 400 Bad Request - The maximum allowed date range is 1 months. API only allows data to be pulled for 1 month or less. + /// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "retry-after" header. + /// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" + /// header. + /// + public partial class GenerateCostDetailsReportErrorResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateCostDetailsReportErrorResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateCostDetailsReportErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ErrorDetails.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.PowerShell.cs new file mode 100644 index 000000000000..20f915be50dc --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.PowerShell.cs @@ -0,0 +1,189 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The definition of a cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateCostDetailsReportRequestDefinitionTypeConverter))] + public partial class GenerateCostDetailsReportRequestDefinition + { + + /// + /// 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.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateCostDetailsReportRequestDefinition(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.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateCostDetailsReportRequestDefinition(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.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateCostDetailsReportRequestDefinition(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.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType.CreateFrom); + } + if (content.Contains("BillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod = (string) content.GetValueForProperty("BillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)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 GenerateCostDetailsReportRequestDefinition(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.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("TimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType?) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType.CreateFrom); + } + if (content.Contains("BillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod = (string) content.GetValueForProperty("BillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).BillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("InvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId = (string) content.GetValueForProperty("InvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).InvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The definition of a cost detailed report. + [System.ComponentModel.TypeConverter(typeof(GenerateCostDetailsReportRequestDefinitionTypeConverter))] + public partial interface IGenerateCostDetailsReportRequestDefinition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.TypeConverter.cs new file mode 100644 index 000000000000..efade7a565d1 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.TypeConverter.cs @@ -0,0 +1,151 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateCostDetailsReportRequestDefinitionTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateCostDetailsReportRequestDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateCostDetailsReportRequestDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateCostDetailsReportRequestDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.cs new file mode 100644 index 000000000000..b4d87982037a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.cs @@ -0,0 +1,164 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a cost detailed report. + public partial class GenerateCostDetailsReportRequestDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal + { + + /// Backing field for property. + private string _billingPeriod; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string BillingPeriod { get => this._billingPeriod; set => this._billingPeriod = value; } + + /// Backing field for property. + private string _invoiceId; + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string InvoiceId { get => this._invoiceId; set => this._invoiceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? _metric; + + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? Metric { get => this._metric; set => this._metric = value; } + + /// Internal Acessors for TimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal.TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriod()); set { {_timePeriod = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod _timePeriod; + + /// + /// 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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod TimePeriod { get => (this._timePeriod = this._timePeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriod()); set => this._timePeriod = value; } + + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)TimePeriod).End; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)TimePeriod).End = value ?? null; } + + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)TimePeriod).Start; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriodInternal)TimePeriod).Start = value ?? null; } + + /// + /// Creates an new instance. + /// + public GenerateCostDetailsReportRequestDefinition() + { + + } + } + /// The definition of a cost detailed report. + public partial interface IGenerateCostDetailsReportRequestDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string BillingPeriod { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string InvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the detailed report. By default ActualCost is provided", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? Metric { get; set; } + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to. example format 2020-03-15", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodEnd { get; set; } + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from. example format 2020-03-15", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodStart { get; set; } + + } + /// The definition of a cost detailed report. + internal partial interface IGenerateCostDetailsReportRequestDefinitionInternal + + { + /// + /// 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. + /// + string BillingPeriod { get; set; } + /// + /// 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. + /// + string InvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? 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.Cost.Models.Api20220501.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 + string TimePeriodStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.json.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.json.cs new file mode 100644 index 000000000000..a78557f81303 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/GenerateCostDetailsReportRequestDefinition.json.cs @@ -0,0 +1,116 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The definition of a cost detailed report. + public partial class GenerateCostDetailsReportRequestDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateCostDetailsReportRequestDefinition(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateCostDetailsReportRequestDefinition(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timePeriod = If( json?.PropertyT("timePeriod"), out var __jsonTimePeriod) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._timePeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._timePeriod.ToJson(null,serializationMode) : null, "timePeriod" ,container.Add ); + AddIf( null != (((object)this._metric)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._metric.ToString()) : null, "metric" ,container.Add ); + AddIf( null != (((object)this._billingPeriod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._billingPeriod.ToString()) : null, "billingPeriod" ,container.Add ); + AddIf( null != (((object)this._invoiceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._invoiceId.ToString()) : null, "invoiceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.PowerShell.cs new file mode 100644 index 000000000000..188cac4c921f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.PowerShell.cs @@ -0,0 +1,256 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Models.Api20220501.IReportManifest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContext = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext) content.GetValueForProperty("RequestContext",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContext, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.RequestContextTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).ManifestVersion, global::System.Convert.ToString); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat?) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat.CreateFrom); + } + if (content.Contains("ByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("BlobCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).BlobCount = (int?) content.GetValueForProperty("BlobCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).BlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CompressData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).CompressData = (bool?) content.GetValueForProperty("CompressData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).CompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).Blob = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[]) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).Blob, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.BlobInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestContextRequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestScope, global::System.Convert.ToString); + } + if (content.Contains("RequestContextRequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType.CreateFrom); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContext = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext) content.GetValueForProperty("RequestContext",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContext, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.RequestContextTypeConverter.ConvertFrom); + } + if (content.Contains("ManifestVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).ManifestVersion = (string) content.GetValueForProperty("ManifestVersion",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).ManifestVersion, global::System.Convert.ToString); + } + if (content.Contains("DataFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).DataFormat = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat?) content.GetValueForProperty("DataFormat",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).DataFormat, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat.CreateFrom); + } + if (content.Contains("ByteCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).ByteCount = (long?) content.GetValueForProperty("ByteCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).ByteCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("BlobCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).BlobCount = (int?) content.GetValueForProperty("BlobCount",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).BlobCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CompressData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).CompressData = (bool?) content.GetValueForProperty("CompressData",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).CompressData, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).Blob = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[]) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).Blob, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.BlobInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("RequestContextRequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestScope = (string) content.GetValueForProperty("RequestContextRequestScope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestScope, global::System.Convert.ToString); + } + if (content.Contains("RequestContextRequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestBody = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestContextRequestBody",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestContextRequestBody, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType.CreateFrom); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.TypeConverter.cs new file mode 100644 index 000000000000..586221b71d2e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ReportManifestTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ReportManifest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ReportManifest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ReportManifest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.cs new file mode 100644 index 000000000000..359512921043 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.cs @@ -0,0 +1,274 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The manifest of the report generated by the operation. + public partial class ReportManifest : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[] _blob; + + /// List of blob information generated by this operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[] Blob { get => this._blob; set => this._blob = value; } + + /// Backing field for property. + private int? _blobCount; + + /// The total number of blobs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public int? BlobCount { get => this._blobCount; set => this._blobCount = value; } + + /// Backing field for property. + private long? _byteCount; + + /// The total number of bytes in all blobs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public long? ByteCount { get => this._byteCount; set => this._byteCount = value; } + + /// Backing field for property. + private bool? _compressData; + + /// Is the data in compressed format. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public bool? CompressData { get => this._compressData; set => this._compressData = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat? _dataFormat; + + /// The data format of the report + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat? DataFormat { get => this._dataFormat; set => this._dataFormat = value; } + + /// Backing field for property. + private string _manifestVersion; + + /// The Manifest version. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string ManifestVersion { get => this._manifestVersion; set => this._manifestVersion = value; } + + /// Internal Acessors for RequestBodyTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal.RequestBodyTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyTimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyTimePeriod = value; } + + /// Internal Acessors for RequestContext + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal.RequestContext { get => (this._requestContext = this._requestContext ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.RequestContext()); set { {_requestContext = value;} } } + + /// Internal Acessors for RequestContextRequestBody + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifestInternal.RequestContextRequestBody { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBody; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBody = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string RequestBodyBillingPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyBillingPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.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 + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string RequestBodyInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyInvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyInvoiceId = value ?? null; } + + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? RequestBodyMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestBodyMetric = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext _requestContext; + + /// The context of the Cost Details request. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext RequestContext { get => (this._requestContext = this._requestContext ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.RequestContext()); set => this._requestContext = value; } + + /// The request scope of the request. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string RequestContextRequestScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).RequestScope = value ?? null; } + + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).TimePeriodEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).TimePeriodEnd = value ?? null; } + + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).TimePeriodStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)RequestContext).TimePeriodStart = value ?? null; } + + /// Creates an new instance. + public ReportManifest() + { + + } + } + /// The manifest of the report generated by the operation. + public partial interface IReportManifest : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// List of blob information generated by this operation. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of blob information generated by this operation.", + SerializedName = @"blobs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[] Blob { get; set; } + /// The total number of blobs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total number of blobs.", + SerializedName = @"blobCount", + PossibleTypes = new [] { typeof(int) })] + int? BlobCount { get; set; } + /// The total number of bytes in all blobs. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The total number of bytes in all blobs.", + SerializedName = @"byteCount", + PossibleTypes = new [] { typeof(long) })] + long? ByteCount { get; set; } + /// Is the data in compressed format. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Is the data in compressed format.", + SerializedName = @"compressData", + PossibleTypes = new [] { typeof(bool) })] + bool? CompressData { get; set; } + /// The data format of the report + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The data format of the report", + SerializedName = @"dataFormat", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat? DataFormat { get; set; } + /// The Manifest version. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Manifest version.", + SerializedName = @"manifestVersion", + PossibleTypes = new [] { typeof(string) })] + string ManifestVersion { 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 + /// is not provided in the request body the API will return the current month's cost. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string RequestBodyBillingPeriod { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string RequestBodyInvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the detailed report. By default ActualCost is provided", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? RequestBodyMetric { get; set; } + /// The request scope of the request. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request scope of the request.", + SerializedName = @"requestScope", + PossibleTypes = new [] { typeof(string) })] + string RequestContextRequestScope { get; set; } + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to. example format 2020-03-15", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodEnd { get; set; } + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from. example format 2020-03-15", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodStart { get; set; } + + } + /// The manifest of the report generated by the operation. + internal partial interface IReportManifestInternal + + { + /// List of blob information generated by this operation. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IBlobInfo[] Blob { get; set; } + /// The total number of blobs. + int? BlobCount { get; set; } + /// The total number of bytes in all blobs. + long? ByteCount { get; set; } + /// Is the data in compressed format. + bool? CompressData { get; set; } + /// The data format of the report + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat? DataFormat { get; set; } + /// The Manifest version. + string ManifestVersion { 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 + /// is not provided in the request body the API will return the current month's cost. + /// + string RequestBodyBillingPeriod { get; set; } + /// + /// 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. + /// + string RequestBodyInvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? 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.Cost.Models.Api20220501.ICostDetailsTimePeriod RequestBodyTimePeriod { get; set; } + /// The context of the Cost Details request. + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext RequestContext { get; set; } + /// The request payload body provided in Cost Details call + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.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 + string TimePeriodEnd { get; set; } + /// The start date to pull data from. example format 2020-03-15 + string TimePeriodStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.json.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.json.cs new file mode 100644 index 000000000000..1110d45d641d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/ReportManifest.json.cs @@ -0,0 +1,128 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The manifest of the report generated by the operation. + public partial class ReportManifest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IReportManifest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new ReportManifest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal ReportManifest(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_requestContext = If( json?.PropertyT("requestContext"), out var __jsonRequestContext) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Models.Api20220501.IBlobInfo) (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.BlobInfo.FromJson(__u) )) ))() : null : Blob;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._requestContext ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._requestContext.ToJson(null,serializationMode) : null, "requestContext" ,container.Add ); + AddIf( null != (((object)this._manifestVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._manifestVersion.ToString()) : null, "manifestVersion" ,container.Add ); + AddIf( null != (((object)this._dataFormat)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._dataFormat.ToString()) : null, "dataFormat" ,container.Add ); + AddIf( null != this._byteCount ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNumber((long)this._byteCount) : null, "byteCount" ,container.Add ); + AddIf( null != this._blobCount ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNumber((int)this._blobCount) : null, "blobCount" ,container.Add ); + AddIf( null != this._compressData ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonBoolean((bool)this._compressData) : null, "compressData" ,container.Add ); + if (null != this._blob) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.XNodeArray(); + foreach( var __x in this._blob ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("blobs",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.PowerShell.cs new file mode 100644 index 000000000000..e6b3b4b8256e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.PowerShell.cs @@ -0,0 +1,200 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// The context of the Cost Details request. + [System.ComponentModel.TypeConverter(typeof(RequestContextTypeConverter))] + public partial class RequestContext + { + + /// + /// 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.Cost.Models.Api20220501.IRequestContext DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RequestContext(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.Cost.Models.Api20220501.IRequestContext DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RequestContext(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.Cost.Models.Api20220501.IRequestContext FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RequestContext(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBody = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBody, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestScope = (string) content.GetValueForProperty("RequestScope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestScope, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType.CreateFrom); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)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 RequestContext(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RequestBody")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBody = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition) content.GetValueForProperty("RequestBody",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBody, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("RequestScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestScope = (string) content.GetValueForProperty("RequestScope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestScope, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyTimePeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyTimePeriod = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod) content.GetValueForProperty("RequestBodyTimePeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyTimePeriod, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.CostDetailsTimePeriodTypeConverter.ConvertFrom); + } + if (content.Contains("RequestBodyMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyMetric = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType?) content.GetValueForProperty("RequestBodyMetric",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyMetric, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType.CreateFrom); + } + if (content.Contains("RequestBodyBillingPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyBillingPeriod = (string) content.GetValueForProperty("RequestBodyBillingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyBillingPeriod, global::System.Convert.ToString); + } + if (content.Contains("RequestBodyInvoiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyInvoiceId = (string) content.GetValueForProperty("RequestBodyInvoiceId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).RequestBodyInvoiceId, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).TimePeriodStart = (string) content.GetValueForProperty("TimePeriodStart",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).TimePeriodStart, global::System.Convert.ToString); + } + if (content.Contains("TimePeriodEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)this).TimePeriodEnd = (string) content.GetValueForProperty("TimePeriodEnd",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal)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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The context of the Cost Details request. + [System.ComponentModel.TypeConverter(typeof(RequestContextTypeConverter))] + public partial interface IRequestContext + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.TypeConverter.cs new file mode 100644 index 000000000000..bb18f2ee26ad --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.Cost.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RequestContextTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RequestContext.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RequestContext.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RequestContext.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.cs new file mode 100644 index 000000000000..3ccade1e59f4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.cs @@ -0,0 +1,170 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The context of the Cost Details request. + public partial class RequestContext : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal + { + + /// Internal Acessors for RequestBody + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal.RequestBody { get => (this._requestBody = this._requestBody ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinition()); set { {_requestBody = value;} } } + + /// Internal Acessors for RequestBodyTimePeriod + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsTimePeriod Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContextInternal.RequestBodyTimePeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriod = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition _requestBody; + + /// The request payload body provided in Cost Details call + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition RequestBody { get => (this._requestBody = this._requestBody ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinition()); set => this._requestBody = value; } + + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string RequestBodyBillingPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).BillingPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.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 + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string RequestBodyInvoiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).InvoiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).InvoiceId = value ?? null; } + + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? RequestBodyMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).Metric = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType)""); } + + /// Backing field for property. + private string _requestScope; + + /// The request scope of the request. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string RequestScope { get => this._requestScope; set => this._requestScope = value; } + + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodEnd; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodEnd = value ?? null; } + + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Inlined)] + public string TimePeriodStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodStart; set => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinitionInternal)RequestBody).TimePeriodStart = value ?? null; } + + /// Creates an new instance. + public RequestContext() + { + + } + } + /// The context of the Cost Details request. + public partial interface IRequestContext : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string RequestBodyBillingPeriod { get; set; } + /// + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string RequestBodyInvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the detailed report. By default ActualCost is provided", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? RequestBodyMetric { get; set; } + /// The request scope of the request. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request scope of the request.", + SerializedName = @"requestScope", + PossibleTypes = new [] { typeof(string) })] + string RequestScope { get; set; } + /// The end date to pull data to. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to. example format 2020-03-15", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodEnd { get; set; } + /// The start date to pull data from. example format 2020-03-15 + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from. example format 2020-03-15", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + string TimePeriodStart { get; set; } + + } + /// The context of the Cost Details request. + internal partial interface IRequestContextInternal + + { + /// The request payload body provided in Cost Details call + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.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 + /// is not provided in the request body the API will return the current month's cost. + /// + string RequestBodyBillingPeriod { get; set; } + /// + /// 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. + /// + string RequestBodyInvoiceId { get; set; } + /// The type of the detailed report. By default ActualCost is provided + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType? 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.Cost.Models.Api20220501.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 + string TimePeriodEnd { get; set; } + /// The start date to pull data from. example format 2020-03-15 + string TimePeriodStart { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.json.cs b/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.json.cs new file mode 100644 index 000000000000..de07fe0c6788 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/Api20220501/RequestContext.json.cs @@ -0,0 +1,110 @@ +// 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.Cost.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + /// The context of the Cost Details request. + public partial class RequestContext + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IRequestContext FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new RequestContext(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal RequestContext(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_requestBody = If( json?.PropertyT("requestBody"), out var __jsonRequestBody) ? Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinition.FromJson(__jsonRequestBody) : RequestBody;} + {_requestScope = If( json?.PropertyT("requestScope"), out var __jsonRequestScope) ? (string)__jsonRequestScope : (string)RequestScope;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._requestBody ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) this._requestBody.ToJson(null,serializationMode) : null, "requestBody" ,container.Add ); + AddIf( null != (((object)this._requestScope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._requestScope.ToString()) : null, "requestScope" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/CostIdentity.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/CostIdentity.PowerShell.cs new file mode 100644 index 000000000000..7a0685dbd3a1 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/CostIdentity.PowerShell.cs @@ -0,0 +1,214 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(CostIdentityTypeConverter))] + public partial class CostIdentity + { + + /// + /// 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 CostIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("OperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).OperationId, global::System.Convert.ToString); + } + if (content.Contains("ViewName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ViewName = (string) content.GetValueForProperty("ViewName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ViewName, global::System.Convert.ToString); + } + if (content.Contains("AlertId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).AlertId = (string) content.GetValueForProperty("AlertId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).AlertId, global::System.Convert.ToString); + } + if (content.Contains("ExternalCloudProviderType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExternalCloudProviderType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType?) content.GetValueForProperty("ExternalCloudProviderType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExternalCloudProviderType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType.CreateFrom); + } + if (content.Contains("ExternalCloudProviderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExternalCloudProviderId = (string) content.GetValueForProperty("ExternalCloudProviderId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExternalCloudProviderId, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("ExportName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExportName = (string) content.GetValueForProperty("ExportName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExportName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).Id, 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 CostIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("OperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).OperationId, global::System.Convert.ToString); + } + if (content.Contains("ViewName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ViewName = (string) content.GetValueForProperty("ViewName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ViewName, global::System.Convert.ToString); + } + if (content.Contains("AlertId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).AlertId = (string) content.GetValueForProperty("AlertId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).AlertId, global::System.Convert.ToString); + } + if (content.Contains("ExternalCloudProviderType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExternalCloudProviderType = (Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType?) content.GetValueForProperty("ExternalCloudProviderType",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExternalCloudProviderType, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType.CreateFrom); + } + if (content.Contains("ExternalCloudProviderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExternalCloudProviderId = (string) content.GetValueForProperty("ExternalCloudProviderId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExternalCloudProviderId, global::System.Convert.ToString); + } + if (content.Contains("BillingAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).BillingAccountId = (string) content.GetValueForProperty("BillingAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).BillingAccountId, global::System.Convert.ToString); + } + if (content.Contains("BillingProfileId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).BillingProfileId = (string) content.GetValueForProperty("BillingProfileId",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).BillingProfileId, global::System.Convert.ToString); + } + if (content.Contains("ExportName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExportName = (string) content.GetValueForProperty("ExportName",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).ExportName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal)this).Id, 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.Cost.Models.ICostIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CostIdentity(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.Cost.Models.ICostIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CostIdentity(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.Cost.Models.ICostIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(CostIdentityTypeConverter))] + public partial interface ICostIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/CostIdentity.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/CostIdentity.TypeConverter.cs new file mode 100644 index 000000000000..723276b6edbe --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/CostIdentity.TypeConverter.cs @@ -0,0 +1,157 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CostIdentityTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + // we allow string conversion too. + if (type == typeof(global::System.String)) + { + return true; + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + // support direct string to id type conversion. + if (type == typeof(global::System.String)) + { + return new CostIdentity { Id = sourceValue }; + } + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CostIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CostIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CostIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/CostIdentity.cs b/swaggerci/cost-management/generated/api/Models/CostIdentity.cs new file mode 100644 index 000000000000..bfe46838dcdb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/CostIdentity.cs @@ -0,0 +1,246 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class CostIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentityInternal + { + + /// Backing field for property. + private string _alertId; + + /// Alert ID + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string AlertId { get => this._alertId; set => this._alertId = value; } + + /// Backing field for property. + private string _billingAccountId; + + /// Enrollment ID (Legacy BillingAccount ID) + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string BillingAccountId { get => this._billingAccountId; set => this._billingAccountId = value; } + + /// Backing field for property. + private string _billingProfileId; + + /// BillingProfile ID + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string BillingProfileId { get => this._billingProfileId; set => this._billingProfileId = value; } + + /// Backing field for property. + private string _exportName; + + /// Export Name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string ExportName { get => this._exportName; set => this._exportName = value; } + + /// Backing field for property. + private string _externalCloudProviderId; + + /// + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used + /// with dimension/query operations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string ExternalCloudProviderId { get => this._externalCloudProviderId; set => this._externalCloudProviderId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType? _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.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType? ExternalCloudProviderType { get => this._externalCloudProviderType; set => this._externalCloudProviderType = value; } + + /// Backing field for property. + private string _id; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _operationId; + + /// The target operation Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// 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. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _viewName; + + /// View name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string ViewName { get => this._viewName; set => this._viewName = value; } + + /// Creates an new instance. + public CostIdentity() + { + + } + } + public partial interface ICostIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable + { + /// Alert ID + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert ID", + SerializedName = @"alertId", + PossibleTypes = new [] { typeof(string) })] + string AlertId { get; set; } + /// Enrollment ID (Legacy BillingAccount ID) + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enrollment ID (Legacy BillingAccount ID)", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + string BillingAccountId { get; set; } + /// BillingProfile ID + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"BillingProfile ID", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + string BillingProfileId { get; set; } + /// Export Name. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Export Name.", + SerializedName = @"exportName", + PossibleTypes = new [] { typeof(string) })] + string ExportName { get; set; } + /// + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used + /// with dimension/query operations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", + SerializedName = @"externalCloudProviderId", + PossibleTypes = new [] { typeof(string) })] + string ExternalCloudProviderId { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Support.ExternalCloudProviderType) })] + Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType? ExternalCloudProviderType { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The target operation Id. + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target operation Id.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + /// + /// 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.Cost.Runtime.Info( + Required = false, + 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) })] + string Scope { get; set; } + /// View name + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"View name", + SerializedName = @"viewName", + PossibleTypes = new [] { typeof(string) })] + string ViewName { get; set; } + + } + internal partial interface ICostIdentityInternal + + { + /// Alert ID + string AlertId { get; set; } + /// Enrollment ID (Legacy BillingAccount ID) + string BillingAccountId { get; set; } + /// BillingProfile ID + string BillingProfileId { get; set; } + /// Export Name. + string ExportName { get; set; } + /// + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used + /// with dimension/query operations. + /// + string ExternalCloudProviderId { get; set; } + /// + /// 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.Cost.Support.ExternalCloudProviderType? ExternalCloudProviderType { get; set; } + /// Resource identity path + string Id { get; set; } + /// The target operation Id. + string OperationId { get; set; } + /// + /// 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. + /// + string Scope { get; set; } + /// View name + string ViewName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/CostIdentity.json.cs b/swaggerci/cost-management/generated/api/Models/CostIdentity.json.cs new file mode 100644 index 000000000000..9570d2f4dc79 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/CostIdentity.json.cs @@ -0,0 +1,123 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class CostIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal CostIdentity(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + {_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;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity. + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new CostIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); + AddIf( null != (((object)this._operationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._operationId.ToString()) : null, "operationId" ,container.Add ); + AddIf( null != (((object)this._viewName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._viewName.ToString()) : null, "viewName" ,container.Add ); + AddIf( null != (((object)this._alertId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._alertId.ToString()) : null, "alertId" ,container.Add ); + AddIf( null != (((object)this._externalCloudProviderType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._externalCloudProviderType.ToString()) : null, "externalCloudProviderType" ,container.Add ); + AddIf( null != (((object)this._externalCloudProviderId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._externalCloudProviderId.ToString()) : null, "externalCloudProviderId" ,container.Add ); + AddIf( null != (((object)this._billingAccountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._billingAccountId.ToString()) : null, "billingAccountId" ,container.Add ); + AddIf( null != (((object)this._billingProfileId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._billingProfileId.ToString()) : null, "billingProfileId" ,container.Add ); + AddIf( null != (((object)this._exportName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._exportName.ToString()) : null, "exportName" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..9d7c4e984fa3 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.PowerShell.cs @@ -0,0 +1,155 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(GenerateCostDetailsReportCreateOperationAcceptedResponseHeadersTypeConverter))] + public partial class GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders + { + + /// + /// 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.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders(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.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders(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.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RetryAfter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter = (int?) content.GetValueForProperty("RetryAfter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RetryAfter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter = (int?) content.GetValueForProperty("RetryAfter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(GenerateCostDetailsReportCreateOperationAcceptedResponseHeadersTypeConverter))] + public partial interface IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..f06ce4b33fed --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.TypeConverter.cs @@ -0,0 +1,153 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateCostDetailsReportCreateOperationAcceptedResponseHeadersTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.cs b/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..23245e75ddb9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.cs @@ -0,0 +1,77 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private int? _retryAfter; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public int? RetryAfter { get => this._retryAfter; set => this._retryAfter = value; } + + /// + /// Creates an new instance. + /// + public GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Retry-After", out var __retryAfterHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter = System.Linq.Enumerable.FirstOrDefault(__retryAfterHeader1) is string __headerRetryAfterHeader1 ? int.TryParse( __headerRetryAfterHeader1, out int __headerRetryAfterHeader1Value ) ? __headerRetryAfterHeader1Value : default(int?) : default(int?); + } + } + } + public partial interface IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Retry-After", + PossibleTypes = new [] { typeof(int) })] + int? RetryAfter { get; set; } + + } + internal partial interface IGenerateCostDetailsReportCreateOperationAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + int? RetryAfter { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.json.cs b/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..46a9b2a98c63 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateCostDetailsReportCreateOperationAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateCostDetailsReportCreateOperationAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..20bb70818969 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.PowerShell.cs @@ -0,0 +1,171 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportCreateOperationAcceptedResponseHeadersTypeConverter))] + public partial class GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders + { + + /// + /// 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.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders(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.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders(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.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("AzureConsumptionAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureConsumptionAsyncOperation = (string) content.GetValueForProperty("AzureConsumptionAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureConsumptionAsyncOperation, global::System.Convert.ToString); + } + if (content.Contains("AzureAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation = (string) content.GetValueForProperty("AzureAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation, global::System.Convert.ToString); + } + if (content.Contains("RetryAfter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter = (int?) content.GetValueForProperty("RetryAfter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("AzureConsumptionAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureConsumptionAsyncOperation = (string) content.GetValueForProperty("AzureConsumptionAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureConsumptionAsyncOperation, global::System.Convert.ToString); + } + if (content.Contains("AzureAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation = (string) content.GetValueForProperty("AzureAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation, global::System.Convert.ToString); + } + if (content.Contains("RetryAfter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter = (int?) content.GetValueForProperty("RetryAfter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(GenerateDetailedCostReportCreateOperationAcceptedResponseHeadersTypeConverter))] + public partial interface IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..64eb7782b8bd --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.TypeConverter.cs @@ -0,0 +1,153 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateDetailedCostReportCreateOperationAcceptedResponseHeadersTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there + /// is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.cs b/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..3c810bfbd1a7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.cs @@ -0,0 +1,117 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _azureConsumptionAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string AzureConsumptionAsyncOperation { get => this._azureConsumptionAsyncOperation; set => this._azureConsumptionAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private int? _retryAfter; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public int? RetryAfter { get => this._retryAfter; set => this._retryAfter = value; } + + /// + /// Creates an new instance. + /// + public GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-Consumption-AsyncOperation", out var __azureConsumptionAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureConsumptionAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureConsumptionAsyncOperationHeader1) is string __headerAzureConsumptionAsyncOperationHeader1 ? __headerAzureConsumptionAsyncOperationHeader1 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader2)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader2) is string __headerAzureAsyncOperationHeader2 ? __headerAzureAsyncOperationHeader2 : (string)null; + } + if (headers.TryGetValues("Retry-After", out var __retryAfterHeader3)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal)this).RetryAfter = System.Linq.Enumerable.FirstOrDefault(__retryAfterHeader3) is string __headerRetryAfterHeader3 ? int.TryParse( __headerRetryAfterHeader3, out int __headerRetryAfterHeader3Value ) ? __headerRetryAfterHeader3Value : default(int?) : default(int?); + } + } + } + public partial interface IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-Consumption-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureConsumptionAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Retry-After", + PossibleTypes = new [] { typeof(int) })] + int? RetryAfter { get; set; } + + } + internal partial interface IGenerateDetailedCostReportCreateOperationAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string AzureConsumptionAsyncOperation { get; set; } + + string Location { get; set; } + + int? RetryAfter { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.json.cs b/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..ee0d3be6a210 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateDetailedCostReportCreateOperationAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateDetailedCostReportCreateOperationAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..af42247911c5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.PowerShell.cs @@ -0,0 +1,155 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersTypeConverter))] + public partial class GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders + { + + /// + /// 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.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders(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.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders(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.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RetryAfter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).RetryAfter = (int?) content.GetValueForProperty("RetryAfter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).RetryAfter, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RetryAfter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).RetryAfter = (int?) content.GetValueForProperty("RetryAfter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).RetryAfter, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersTypeConverter))] + public partial interface IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..29529dd53a66 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.TypeConverter.cs @@ -0,0 +1,153 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null + /// if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.cs b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..0594d84c87e6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.cs @@ -0,0 +1,77 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private int? _retryAfter; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public int? RetryAfter { get => this._retryAfter; set => this._retryAfter = value; } + + /// + /// Creates an new instance. + /// + public GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Retry-After", out var __retryAfterHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal)this).RetryAfter = System.Linq.Enumerable.FirstOrDefault(__retryAfterHeader1) is string __headerRetryAfterHeader1 ? int.TryParse( __headerRetryAfterHeader1, out int __headerRetryAfterHeader1Value ) ? __headerRetryAfterHeader1Value : default(int?) : default(int?); + } + } + } + public partial interface IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Retry-After", + PossibleTypes = new [] { typeof(int) })] + int? RetryAfter { get; set; } + + } + internal partial interface IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + int? RetryAfter { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.json.cs b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..5a53daf34560 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateReservationDetailsReportByBillingAccountIdAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into + /// a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a + /// . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.PowerShell.cs b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..5dc6b9b03831 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.PowerShell.cs @@ -0,0 +1,155 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersTypeConverter))] + public partial class GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders + { + + /// + /// 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.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders(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.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders(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.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RetryAfter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).RetryAfter = (int?) content.GetValueForProperty("RetryAfter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).RetryAfter, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RetryAfter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).RetryAfter = (int?) content.GetValueForProperty("RetryAfter",((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).RetryAfter, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.Cost.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersTypeConverter))] + public partial interface IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..a234b3097804 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.TypeConverter.cs @@ -0,0 +1,153 @@ +// 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.Cost.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null + /// if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.cs b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..5bddd77c3008 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.cs @@ -0,0 +1,77 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private int? _retryAfter; + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Origin(Microsoft.Azure.PowerShell.Cmdlets.Cost.PropertyOrigin.Owned)] + public int? RetryAfter { get => this._retryAfter; set => this._retryAfter = value; } + + /// + /// Creates an new instance. + /// + public GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Retry-After", out var __retryAfterHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal)this).RetryAfter = System.Linq.Enumerable.FirstOrDefault(__retryAfterHeader1) is string __headerRetryAfterHeader1 ? int.TryParse( __headerRetryAfterHeader1, out int __headerRetryAfterHeader1Value ) ? __headerRetryAfterHeader1Value : default(int?) : default(int?); + } + } + } + public partial interface IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Retry-After", + PossibleTypes = new [] { typeof(int) })] + int? RetryAfter { get; set; } + + } + internal partial interface IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + int? RetryAfter { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.json.cs b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..e50328de70dc --- /dev/null +++ b/swaggerci/cost-management/generated/api/Models/GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// 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.Cost.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public partial class GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IGenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject instance to deserialize from. + internal GenerateReservationDetailsReportByBillingProfileIdAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into + /// a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a + /// . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/AccumulatedType.Completer.cs b/swaggerci/cost-management/generated/api/Support/AccumulatedType.Completer.cs new file mode 100644 index 000000000000..f38ea03a7dec --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AccumulatedType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// Show costs accumulated over time. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/AccumulatedType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/AccumulatedType.TypeConverter.cs new file mode 100644 index 000000000000..e7affa2a8018 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AccumulatedType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/AccumulatedType.cs b/swaggerci/cost-management/generated/api/Support/AccumulatedType.cs new file mode 100644 index 000000000000..dc29a0b5de77 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AccumulatedType.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// Show costs accumulated over time. + public partial struct AccumulatedType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType False = @"false"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.AccumulatedType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AccumulatedType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/AlertCategory.Completer.cs b/swaggerci/cost-management/generated/api/Support/AlertCategory.Completer.cs new file mode 100644 index 000000000000..5de17d0ccf02 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertCategory.Completer.cs @@ -0,0 +1,47 @@ +// 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.Cost.Support +{ + + /// Alert category + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/AlertCategory.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/AlertCategory.TypeConverter.cs new file mode 100644 index 000000000000..4db9c11d2583 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertCategory.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/AlertCategory.cs b/swaggerci/cost-management/generated/api/Support/AlertCategory.cs new file mode 100644 index 000000000000..de0ee3641376 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertCategory.cs @@ -0,0 +1,102 @@ +// 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.Cost.Support +{ + + /// Alert category + public partial struct AlertCategory : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory Billing = @"Billing"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory Cost = @"Cost"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory System = @"System"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.AlertCategory e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertCategory e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/AlertCriteria.Completer.cs b/swaggerci/cost-management/generated/api/Support/AlertCriteria.Completer.cs new file mode 100644 index 000000000000..01e242014e07 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertCriteria.Completer.cs @@ -0,0 +1,87 @@ +// 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.Cost.Support +{ + + /// Criteria that triggered alert + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/AlertCriteria.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/AlertCriteria.TypeConverter.cs new file mode 100644 index 000000000000..6f273a8e1ae6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertCriteria.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/AlertCriteria.cs b/swaggerci/cost-management/generated/api/Support/AlertCriteria.cs new file mode 100644 index 000000000000..a22ffe3df860 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertCriteria.cs @@ -0,0 +1,122 @@ +// 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.Cost.Support +{ + + /// Criteria that triggered alert + public partial struct AlertCriteria : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria CostThresholdExceeded = @"CostThresholdExceeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria CreditThresholdApproaching = @"CreditThresholdApproaching"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria CreditThresholdReached = @"CreditThresholdReached"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria CrossCloudCollectionError = @"CrossCloudCollectionError"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria CrossCloudNewDataAvailable = @"CrossCloudNewDataAvailable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria ForecastCostThresholdExceeded = @"ForecastCostThresholdExceeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria ForecastUsageThresholdExceeded = @"ForecastUsageThresholdExceeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria GeneralThresholdError = @"GeneralThresholdError"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria InvoiceDueDateApproaching = @"InvoiceDueDateApproaching"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria InvoiceDueDateReached = @"InvoiceDueDateReached"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria MultiCurrency = @"MultiCurrency"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria QuotaThresholdApproaching = @"QuotaThresholdApproaching"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria QuotaThresholdReached = @"QuotaThresholdReached"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.AlertCriteria e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertCriteria e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/AlertOperator.Completer.cs b/swaggerci/cost-management/generated/api/Support/AlertOperator.Completer.cs new file mode 100644 index 000000000000..32851f63d659 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertOperator.Completer.cs @@ -0,0 +1,55 @@ +// 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.Cost.Support +{ + + /// operator used to compare currentSpend with amount + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/AlertOperator.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/AlertOperator.TypeConverter.cs new file mode 100644 index 000000000000..d2138f202d3d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertOperator.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/AlertOperator.cs b/swaggerci/cost-management/generated/api/Support/AlertOperator.cs new file mode 100644 index 000000000000..d09377b26676 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertOperator.cs @@ -0,0 +1,106 @@ +// 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.Cost.Support +{ + + /// operator used to compare currentSpend with amount + public partial struct AlertOperator : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator EqualTo = @"EqualTo"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator GreaterThan = @"GreaterThan"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator GreaterThanOrEqualTo = @"GreaterThanOrEqualTo"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator LessThan = @"LessThan"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator LessThanOrEqualTo = @"LessThanOrEqualTo"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.AlertOperator e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertOperator e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/AlertSource.Completer.cs b/swaggerci/cost-management/generated/api/Support/AlertSource.Completer.cs new file mode 100644 index 000000000000..eb6a50eed6d0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertSource.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// Source of alert + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/AlertSource.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/AlertSource.TypeConverter.cs new file mode 100644 index 000000000000..9513df9e9639 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertSource.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/AlertSource.cs b/swaggerci/cost-management/generated/api/Support/AlertSource.cs new file mode 100644 index 000000000000..5ecf4a6c7856 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertSource.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// Source of alert + public partial struct AlertSource : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource Preset = @"Preset"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.AlertSource e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertSource e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/AlertStatus.Completer.cs b/swaggerci/cost-management/generated/api/Support/AlertStatus.Completer.cs new file mode 100644 index 000000000000..2c44601e861f --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertStatus.Completer.cs @@ -0,0 +1,51 @@ +// 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.Cost.Support +{ + + /// alert status + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/AlertStatus.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/AlertStatus.TypeConverter.cs new file mode 100644 index 000000000000..b5801aa34105 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/AlertStatus.cs b/swaggerci/cost-management/generated/api/Support/AlertStatus.cs new file mode 100644 index 000000000000..7949617d45b8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertStatus.cs @@ -0,0 +1,104 @@ +// 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.Cost.Support +{ + + /// alert status + public partial struct AlertStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus Active = @"Active"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus Dismissed = @"Dismissed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus Overridden = @"Overridden"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.AlertStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/AlertTimeGrainType.Completer.cs b/swaggerci/cost-management/generated/api/Support/AlertTimeGrainType.Completer.cs new file mode 100644 index 000000000000..0e4f34f6d6ff --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertTimeGrainType.Completer.cs @@ -0,0 +1,59 @@ +// 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.Cost.Support +{ + + /// Type of timegrain cadence + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/AlertTimeGrainType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/AlertTimeGrainType.TypeConverter.cs new file mode 100644 index 000000000000..ec585d3f5ebb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertTimeGrainType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/AlertTimeGrainType.cs b/swaggerci/cost-management/generated/api/Support/AlertTimeGrainType.cs new file mode 100644 index 000000000000..38d03fc896e8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertTimeGrainType.cs @@ -0,0 +1,108 @@ +// 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.Cost.Support +{ + + /// Type of timegrain cadence + public partial struct AlertTimeGrainType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType Annually = @"Annually"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType BillingAnnual = @"BillingAnnual"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType BillingMonth = @"BillingMonth"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType BillingQuarter = @"BillingQuarter"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType Monthly = @"Monthly"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.AlertTimeGrainType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertTimeGrainType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/AlertType.Completer.cs b/swaggerci/cost-management/generated/api/Support/AlertType.Completer.cs new file mode 100644 index 000000000000..4fecb1ed5dbc --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertType.Completer.cs @@ -0,0 +1,59 @@ +// 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.Cost.Support +{ + + /// type of alert + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/AlertType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/AlertType.TypeConverter.cs new file mode 100644 index 000000000000..1205173688ea --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/AlertType.cs b/swaggerci/cost-management/generated/api/Support/AlertType.cs new file mode 100644 index 000000000000..0648681fc5f5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/AlertType.cs @@ -0,0 +1,108 @@ +// 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.Cost.Support +{ + + /// type of alert + public partial struct AlertType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType Budget = @"Budget"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType BudgetForecast = @"BudgetForecast"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType Credit = @"Credit"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType General = @"General"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType Invoice = @"Invoice"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType Quota = @"Quota"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.AlertType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.AlertType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ChartType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ChartType.Completer.cs new file mode 100644 index 000000000000..c902e519d283 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ChartType.Completer.cs @@ -0,0 +1,51 @@ +// 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.Cost.Support +{ + + /// Chart type of the main view in Cost Analysis. Required. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/ChartType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ChartType.TypeConverter.cs new file mode 100644 index 000000000000..c8368859f7a6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ChartType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ChartType.cs b/swaggerci/cost-management/generated/api/Support/ChartType.cs new file mode 100644 index 000000000000..d18a91939b44 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ChartType.cs @@ -0,0 +1,104 @@ +// 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.Cost.Support +{ + + /// Chart type of the main view in Cost Analysis. Required. + public partial struct ChartType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType Area = @"Area"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType GroupedColumn = @"GroupedColumn"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType Line = @"Line"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType StackedColumn = @"StackedColumn"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ChartType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ChartType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/CostDetailsDataFormat.Completer.cs b/swaggerci/cost-management/generated/api/Support/CostDetailsDataFormat.Completer.cs new file mode 100644 index 000000000000..6b7356d54250 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/CostDetailsDataFormat.Completer.cs @@ -0,0 +1,35 @@ +// 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.Cost.Support +{ + + /// The data format of the report + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/CostDetailsDataFormat.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/CostDetailsDataFormat.TypeConverter.cs new file mode 100644 index 000000000000..e619629c8395 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/CostDetailsDataFormat.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/CostDetailsDataFormat.cs b/swaggerci/cost-management/generated/api/Support/CostDetailsDataFormat.cs new file mode 100644 index 000000000000..b8ab7ac27d6e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/CostDetailsDataFormat.cs @@ -0,0 +1,97 @@ +// 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.Cost.Support +{ + + /// The data format of the report + public partial struct CostDetailsDataFormat : + System.IEquatable + { + /// Csv data format. + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.CostDetailsDataFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.CostDetailsDataFormat e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsDataFormat e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/CostDetailsMetricType.Completer.cs b/swaggerci/cost-management/generated/api/Support/CostDetailsMetricType.Completer.cs new file mode 100644 index 000000000000..a3672667a07c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/CostDetailsMetricType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// The type of the detailed report. By default ActualCost is provided + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/CostDetailsMetricType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/CostDetailsMetricType.TypeConverter.cs new file mode 100644 index 000000000000..21d57adae24b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/CostDetailsMetricType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/CostDetailsMetricType.cs b/swaggerci/cost-management/generated/api/Support/CostDetailsMetricType.cs new file mode 100644 index 000000000000..75c413aa868e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/CostDetailsMetricType.cs @@ -0,0 +1,100 @@ +// 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.Cost.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.Cost.Support.CostDetailsMetricType ActualCost = @"ActualCost"; + + /// Amortized cost data. + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.CostDetailsMetricType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.CostDetailsMetricType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/CostDetailsStatusType.Completer.cs b/swaggerci/cost-management/generated/api/Support/CostDetailsStatusType.Completer.cs new file mode 100644 index 000000000000..3721d452114b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/CostDetailsStatusType.Completer.cs @@ -0,0 +1,43 @@ +// 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.Cost.Support +{ + + /// The status of the cost details operation + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/CostDetailsStatusType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/CostDetailsStatusType.TypeConverter.cs new file mode 100644 index 000000000000..f7c71970732c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/CostDetailsStatusType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/CostDetailsStatusType.cs b/swaggerci/cost-management/generated/api/Support/CostDetailsStatusType.cs new file mode 100644 index 000000000000..892d0074737c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/CostDetailsStatusType.cs @@ -0,0 +1,103 @@ +// 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.Cost.Support +{ + + /// The status of the cost details operation + public partial struct CostDetailsStatusType : + System.IEquatable + { + /// Operation is Completed. + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType Completed = @"Completed"; + + /// Operation Failed. + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType Failed = @"Failed"; + + /// Operation is Completed and no cost data found. + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.CostDetailsStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.CostDetailsStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsStatusType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ExecutionStatus.Completer.cs b/swaggerci/cost-management/generated/api/Support/ExecutionStatus.Completer.cs new file mode 100644 index 000000000000..a2a3e98a99fa --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExecutionStatus.Completer.cs @@ -0,0 +1,59 @@ +// 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.Cost.Support +{ + + /// The last known status of the export execution. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/ExecutionStatus.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ExecutionStatus.TypeConverter.cs new file mode 100644 index 000000000000..341ca910fed5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExecutionStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ExecutionStatus.cs b/swaggerci/cost-management/generated/api/Support/ExecutionStatus.cs new file mode 100644 index 000000000000..3bd934ce5a2b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExecutionStatus.cs @@ -0,0 +1,108 @@ +// 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.Cost.Support +{ + + /// The last known status of the export execution. + public partial struct ExecutionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus DataNotAvailable = @"DataNotAvailable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus NewDataNotAvailable = @"NewDataNotAvailable"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus Queued = @"Queued"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ExecutionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ExecutionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ExecutionType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ExecutionType.Completer.cs new file mode 100644 index 000000000000..c2809218c3ca --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExecutionType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// The type of the export execution. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/ExecutionType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ExecutionType.TypeConverter.cs new file mode 100644 index 000000000000..5624558dc454 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExecutionType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ExecutionType.cs b/swaggerci/cost-management/generated/api/Support/ExecutionType.cs new file mode 100644 index 000000000000..62f12f7c83a9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExecutionType.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// The type of the export execution. + public partial struct ExecutionType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType OnDemand = @"OnDemand"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ExecutionType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ExecutionType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExecutionType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ExportType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ExportType.Completer.cs new file mode 100644 index 000000000000..0c12524dfa07 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExportType.Completer.cs @@ -0,0 +1,43 @@ +// 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.Cost.Support +{ + + /// The type of the query. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/ExportType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ExportType.TypeConverter.cs new file mode 100644 index 000000000000..a189e8c6dae5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExportType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ExportType.cs b/swaggerci/cost-management/generated/api/Support/ExportType.cs new file mode 100644 index 000000000000..9f512813430a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExportType.cs @@ -0,0 +1,100 @@ +// 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.Cost.Support +{ + + /// The type of the query. + public partial struct ExportType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType ActualCost = @"ActualCost"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType AmortizedCost = @"AmortizedCost"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ExportType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ExportType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ExternalCloudProviderType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ExternalCloudProviderType.Completer.cs new file mode 100644 index 000000000000..823e53ded9a0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExternalCloudProviderType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// Argument completer implementation for ExternalCloudProviderType. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/ExternalCloudProviderType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ExternalCloudProviderType.TypeConverter.cs new file mode 100644 index 000000000000..f74fd4e1196b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExternalCloudProviderType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ExternalCloudProviderType.cs b/swaggerci/cost-management/generated/api/Support/ExternalCloudProviderType.cs new file mode 100644 index 000000000000..0010b2b6085a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ExternalCloudProviderType.cs @@ -0,0 +1,97 @@ +// 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.Cost.Support +{ + + public partial struct ExternalCloudProviderType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType ExternalBillingAccounts = @"externalBillingAccounts"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ExternalCloudProviderType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ExternalCloudProviderType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ForecastType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ForecastType.Completer.cs new file mode 100644 index 000000000000..acf3306bd65d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ForecastType.Completer.cs @@ -0,0 +1,43 @@ +// 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.Cost.Support +{ + + /// The type of the forecast. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/ForecastType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ForecastType.TypeConverter.cs new file mode 100644 index 000000000000..1814a55b246b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ForecastType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ForecastType.cs b/swaggerci/cost-management/generated/api/Support/ForecastType.cs new file mode 100644 index 000000000000..71f5267491c8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ForecastType.cs @@ -0,0 +1,100 @@ +// 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.Cost.Support +{ + + /// The type of the forecast. + public partial struct ForecastType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType ActualCost = @"ActualCost"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType AmortizedCost = @"AmortizedCost"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ForecastType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ForecastType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/FormatType.Completer.cs b/swaggerci/cost-management/generated/api/Support/FormatType.Completer.cs new file mode 100644 index 000000000000..086f29ab862c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/FormatType.Completer.cs @@ -0,0 +1,35 @@ +// 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.Cost.Support +{ + + /// The format of the export being delivered. Currently only 'Csv' is supported. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/FormatType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/FormatType.TypeConverter.cs new file mode 100644 index 000000000000..78ab46b23796 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/FormatType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/FormatType.cs b/swaggerci/cost-management/generated/api/Support/FormatType.cs new file mode 100644 index 000000000000..cf8b47cd3fa6 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/FormatType.cs @@ -0,0 +1,96 @@ +// 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.Cost.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.Cost.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.Cost.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.Cost.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.Cost.Support.FormatType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.FormatType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/FunctionName.Completer.cs b/swaggerci/cost-management/generated/api/Support/FunctionName.Completer.cs new file mode 100644 index 000000000000..e05ac58d82ef --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/FunctionName.Completer.cs @@ -0,0 +1,47 @@ +// 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.Cost.Support +{ + + /// The name of the column to aggregate. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/FunctionName.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/FunctionName.TypeConverter.cs new file mode 100644 index 000000000000..b7a8b71f85b2 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/FunctionName.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/FunctionName.cs b/swaggerci/cost-management/generated/api/Support/FunctionName.cs new file mode 100644 index 000000000000..c2105442886e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/FunctionName.cs @@ -0,0 +1,102 @@ +// 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.Cost.Support +{ + + /// The name of the column to aggregate. + public partial struct FunctionName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName Cost = @"Cost"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName CostUsd = @"CostUSD"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName PreTaxCost = @"PreTaxCost"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.FunctionName e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.FunctionName e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FunctionName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/GenerateDetailedCostReportMetricType.Completer.cs b/swaggerci/cost-management/generated/api/Support/GenerateDetailedCostReportMetricType.Completer.cs new file mode 100644 index 000000000000..2369794cf4d3 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/GenerateDetailedCostReportMetricType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// The type of the detailed report. By default ActualCost is provided + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricTypeTypeConverter))] + public partial struct GenerateDetailedCostReportMetricType : + 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/swaggerci/cost-management/generated/api/Support/GenerateDetailedCostReportMetricType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/GenerateDetailedCostReportMetricType.TypeConverter.cs new file mode 100644 index 000000000000..089f5eedd13a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/GenerateDetailedCostReportMetricType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.Support +{ + + /// The type of the detailed report. By default ActualCost is provided + public partial class GenerateDetailedCostReportMetricTypeTypeConverter : + 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) => GenerateDetailedCostReportMetricType.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/swaggerci/cost-management/generated/api/Support/GenerateDetailedCostReportMetricType.cs b/swaggerci/cost-management/generated/api/Support/GenerateDetailedCostReportMetricType.cs new file mode 100644 index 000000000000..d4554602ae1b --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/GenerateDetailedCostReportMetricType.cs @@ -0,0 +1,104 @@ +// 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.Cost.Support +{ + + /// The type of the detailed report. By default ActualCost is provided + public partial struct GenerateDetailedCostReportMetricType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType ActualCost = @"ActualCost"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType AmortizedCost = @"AmortizedCost"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to GenerateDetailedCostReportMetricType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new GenerateDetailedCostReportMetricType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type GenerateDetailedCostReportMetricType + /// 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.Cost.Support.GenerateDetailedCostReportMetricType e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type GenerateDetailedCostReportMetricType (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 GenerateDetailedCostReportMetricType && Equals((GenerateDetailedCostReportMetricType)obj); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private GenerateDetailedCostReportMetricType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum GenerateDetailedCostReportMetricType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for GenerateDetailedCostReportMetricType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to GenerateDetailedCostReportMetricType + /// the value to convert to an instance of . + + public static implicit operator GenerateDetailedCostReportMetricType(string value) + { + return new GenerateDetailedCostReportMetricType(value); + } + + /// Implicit operator to convert GenerateDetailedCostReportMetricType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType e) + { + return e._value; + } + + /// Overriding != operator for enum GenerateDetailedCostReportMetricType + /// 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.Cost.Support.GenerateDetailedCostReportMetricType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum GenerateDetailedCostReportMetricType + /// 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.Cost.Support.GenerateDetailedCostReportMetricType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/GranularityType.Completer.cs b/swaggerci/cost-management/generated/api/Support/GranularityType.Completer.cs new file mode 100644 index 000000000000..cccae943a283 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/GranularityType.Completer.cs @@ -0,0 +1,35 @@ +// 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.Cost.Support +{ + + /// The granularity of rows in the forecast. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/GranularityType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/GranularityType.TypeConverter.cs new file mode 100644 index 000000000000..56255cb4e0eb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/GranularityType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/GranularityType.cs b/swaggerci/cost-management/generated/api/Support/GranularityType.cs new file mode 100644 index 000000000000..45414019924a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/GranularityType.cs @@ -0,0 +1,96 @@ +// 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.Cost.Support +{ + + /// The granularity of rows in the forecast. + public partial struct GranularityType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.GranularityType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.GranularityType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/KpiType.Completer.cs b/swaggerci/cost-management/generated/api/Support/KpiType.Completer.cs new file mode 100644 index 000000000000..3e81b23f4c82 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/KpiType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// KPI type (Forecast, Budget). + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/KpiType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/KpiType.TypeConverter.cs new file mode 100644 index 000000000000..6f187f54dab3 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/KpiType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/KpiType.cs b/swaggerci/cost-management/generated/api/Support/KpiType.cs new file mode 100644 index 000000000000..751b93045110 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/KpiType.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// KPI type (Forecast, Budget). + public partial struct KpiType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType Budget = @"Budget"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.KpiType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.KpiType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.KpiType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/MetricType.Completer.cs b/swaggerci/cost-management/generated/api/Support/MetricType.Completer.cs new file mode 100644 index 000000000000..7babb8430775 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/MetricType.Completer.cs @@ -0,0 +1,43 @@ +// 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.Cost.Support +{ + + /// Metric to use when displaying costs. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/MetricType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/MetricType.TypeConverter.cs new file mode 100644 index 000000000000..55f18c868167 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/MetricType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/MetricType.cs b/swaggerci/cost-management/generated/api/Support/MetricType.cs new file mode 100644 index 000000000000..26f84500b7af --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/MetricType.cs @@ -0,0 +1,100 @@ +// 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.Cost.Support +{ + + /// Metric to use when displaying costs. + public partial struct MetricType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType ActualCost = @"ActualCost"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType Ahub = @"AHUB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.MetricType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.MetricType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/OperationStatusType.Completer.cs b/swaggerci/cost-management/generated/api/Support/OperationStatusType.Completer.cs new file mode 100644 index 000000000000..5618cf9efcec --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/OperationStatusType.Completer.cs @@ -0,0 +1,43 @@ +// 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.Cost.Support +{ + + /// The status of the long running operation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/OperationStatusType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/OperationStatusType.TypeConverter.cs new file mode 100644 index 000000000000..9a3325078382 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/OperationStatusType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/OperationStatusType.cs b/swaggerci/cost-management/generated/api/Support/OperationStatusType.cs new file mode 100644 index 000000000000..00520035926e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/OperationStatusType.cs @@ -0,0 +1,100 @@ +// 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.Cost.Support +{ + + /// The status of the long running operation. + public partial struct OperationStatusType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.OperationStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.OperationStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperationStatusType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/OperatorType.Completer.cs b/swaggerci/cost-management/generated/api/Support/OperatorType.Completer.cs new file mode 100644 index 000000000000..9d5aea40b711 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/OperatorType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// The operator to use for comparison. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/OperatorType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/OperatorType.TypeConverter.cs new file mode 100644 index 000000000000..3a03ce363f62 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/OperatorType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/OperatorType.cs b/swaggerci/cost-management/generated/api/Support/OperatorType.cs new file mode 100644 index 000000000000..fadbf1235230 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/OperatorType.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// The operator to use for comparison. + public partial struct OperatorType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType Contains = @"Contains"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.OperatorType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.OperatorType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/PivotType.Completer.cs b/swaggerci/cost-management/generated/api/Support/PivotType.Completer.cs new file mode 100644 index 000000000000..f183e7cdec72 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/PivotType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// Data type to show in view. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/PivotType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/PivotType.TypeConverter.cs new file mode 100644 index 000000000000..55cc451da5e9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/PivotType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/PivotType.cs b/swaggerci/cost-management/generated/api/Support/PivotType.cs new file mode 100644 index 000000000000..0c5ade083ca0 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/PivotType.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// Data type to show in view. + public partial struct PivotType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType Dimension = @"Dimension"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.PivotType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.PivotType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.PivotType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/QueryColumnType.Completer.cs b/swaggerci/cost-management/generated/api/Support/QueryColumnType.Completer.cs new file mode 100644 index 000000000000..1714d7ff3fe3 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/QueryColumnType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// The type of the column in the export. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/QueryColumnType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/QueryColumnType.TypeConverter.cs new file mode 100644 index 000000000000..2371fd3886b4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/QueryColumnType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/QueryColumnType.cs b/swaggerci/cost-management/generated/api/Support/QueryColumnType.cs new file mode 100644 index 000000000000..22310d27e73d --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/QueryColumnType.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// The type of the column in the export. + public partial struct QueryColumnType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType Dimension = @"Dimension"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.QueryColumnType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.QueryColumnType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.QueryColumnType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/RecurrenceType.Completer.cs b/swaggerci/cost-management/generated/api/Support/RecurrenceType.Completer.cs new file mode 100644 index 000000000000..8076f3a5d4b8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/RecurrenceType.Completer.cs @@ -0,0 +1,47 @@ +// 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.Cost.Support +{ + + /// The schedule recurrence. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/RecurrenceType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/RecurrenceType.TypeConverter.cs new file mode 100644 index 000000000000..06aa1bc406a5 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/RecurrenceType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/RecurrenceType.cs b/swaggerci/cost-management/generated/api/Support/RecurrenceType.cs new file mode 100644 index 000000000000..9fba72d434e9 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/RecurrenceType.cs @@ -0,0 +1,102 @@ +// 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.Cost.Support +{ + + /// The schedule recurrence. + public partial struct RecurrenceType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType Annually = @"Annually"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType Daily = @"Daily"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType Monthly = @"Monthly"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.RecurrenceType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.RecurrenceType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ReportConfigColumnType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ReportConfigColumnType.Completer.cs new file mode 100644 index 000000000000..9c80a4e18dfe --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportConfigColumnType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// The type of the column in the report. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/ReportConfigColumnType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ReportConfigColumnType.TypeConverter.cs new file mode 100644 index 000000000000..8bffe82f63ea --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportConfigColumnType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ReportConfigColumnType.cs b/swaggerci/cost-management/generated/api/Support/ReportConfigColumnType.cs new file mode 100644 index 000000000000..27c7482c97c8 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportConfigColumnType.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// The type of the column in the report. + public partial struct ReportConfigColumnType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType Dimension = @"Dimension"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ReportConfigColumnType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ReportConfigColumnType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigColumnType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ReportConfigSortingType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ReportConfigSortingType.Completer.cs new file mode 100644 index 000000000000..c80f1b5661ac --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportConfigSortingType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// Direction of sort. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/ReportConfigSortingType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ReportConfigSortingType.TypeConverter.cs new file mode 100644 index 000000000000..10d814589a5c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportConfigSortingType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ReportConfigSortingType.cs b/swaggerci/cost-management/generated/api/Support/ReportConfigSortingType.cs new file mode 100644 index 000000000000..caf4d26e0d8e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportConfigSortingType.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// Direction of sort. + public partial struct ReportConfigSortingType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType Ascending = @"Ascending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ReportConfigSortingType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ReportConfigSortingType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportConfigSortingType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ReportGranularityType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ReportGranularityType.Completer.cs new file mode 100644 index 000000000000..f2e44c3280da --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportGranularityType.Completer.cs @@ -0,0 +1,39 @@ +// 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.Cost.Support +{ + + /// The granularity of rows in the report. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/ReportGranularityType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ReportGranularityType.TypeConverter.cs new file mode 100644 index 000000000000..68574c62354a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportGranularityType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ReportGranularityType.cs b/swaggerci/cost-management/generated/api/Support/ReportGranularityType.cs new file mode 100644 index 000000000000..c27bbd5d5ccb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportGranularityType.cs @@ -0,0 +1,98 @@ +// 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.Cost.Support +{ + + /// The granularity of rows in the report. + public partial struct ReportGranularityType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType Daily = @"Daily"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ReportGranularityType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ReportGranularityType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportGranularityType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ReportOperationStatusType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ReportOperationStatusType.Completer.cs new file mode 100644 index 000000000000..97d49a18fe25 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportOperationStatusType.Completer.cs @@ -0,0 +1,59 @@ +// 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.Cost.Support +{ + + /// The status of the long running operation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusTypeTypeConverter))] + public partial struct ReportOperationStatusType : + 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) || "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) || "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) || "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) || "ReadyToDownload".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ReadyToDownload'", "ReadyToDownload", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReadyToDownload"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TimedOut".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TimedOut'", "TimedOut", global::System.Management.Automation.CompletionResultType.ParameterValue, "TimedOut"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ReportOperationStatusType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ReportOperationStatusType.TypeConverter.cs new file mode 100644 index 000000000000..a30601881e17 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportOperationStatusType.TypeConverter.cs @@ -0,0 +1,59 @@ +// 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.Cost.Support +{ + + /// The status of the long running operation. + public partial class ReportOperationStatusTypeTypeConverter : + 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) => ReportOperationStatusType.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/swaggerci/cost-management/generated/api/Support/ReportOperationStatusType.cs b/swaggerci/cost-management/generated/api/Support/ReportOperationStatusType.cs new file mode 100644 index 000000000000..60627834ea10 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportOperationStatusType.cs @@ -0,0 +1,108 @@ +// 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.Cost.Support +{ + + /// The status of the long running operation. + public partial struct ReportOperationStatusType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType NoDataFound = @"NoDataFound"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType Queued = @"Queued"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType ReadyToDownload = @"ReadyToDownload"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType TimedOut = @"TimedOut"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ReportOperationStatusType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ReportOperationStatusType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ReportOperationStatusType + /// 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.Cost.Support.ReportOperationStatusType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ReportOperationStatusType (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 ReportOperationStatusType && Equals((ReportOperationStatusType)obj); + } + + /// Returns hashCode for enum ReportOperationStatusType + /// 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 ReportOperationStatusType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ReportOperationStatusType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ReportOperationStatusType + /// the value to convert to an instance of . + + public static implicit operator ReportOperationStatusType(string value) + { + return new ReportOperationStatusType(value); + } + + /// Implicit operator to convert ReportOperationStatusType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType e) + { + return e._value; + } + + /// Overriding != operator for enum ReportOperationStatusType + /// 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.Cost.Support.ReportOperationStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ReportOperationStatusType + /// 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.Cost.Support.ReportOperationStatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportOperationStatusType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ReportTimeframeType.Completer.cs b/swaggerci/cost-management/generated/api/Support/ReportTimeframeType.Completer.cs new file mode 100644 index 000000000000..6d1af995d61c --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportTimeframeType.Completer.cs @@ -0,0 +1,49 @@ +// 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.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Support/ReportTimeframeType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ReportTimeframeType.TypeConverter.cs new file mode 100644 index 000000000000..c62705992816 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportTimeframeType.TypeConverter.cs @@ -0,0 +1,61 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ReportTimeframeType.cs b/swaggerci/cost-management/generated/api/Support/ReportTimeframeType.cs new file mode 100644 index 000000000000..b411ec91644e --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReportTimeframeType.cs @@ -0,0 +1,104 @@ +// 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.Cost.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.Cost.Support.ReportTimeframeType Custom = @"Custom"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType MonthToDate = @"MonthToDate"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType WeekToDate = @"WeekToDate"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ReportTimeframeType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ReportTimeframeType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReportTimeframeType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/ReservationReportSchema.Completer.cs b/swaggerci/cost-management/generated/api/Support/ReservationReportSchema.Completer.cs new file mode 100644 index 000000000000..e5dfe38492bb --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReservationReportSchema.Completer.cs @@ -0,0 +1,77 @@ +// 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.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Support/ReservationReportSchema.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/ReservationReportSchema.TypeConverter.cs new file mode 100644 index 000000000000..f250cebcb851 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReservationReportSchema.TypeConverter.cs @@ -0,0 +1,61 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/ReservationReportSchema.cs b/swaggerci/cost-management/generated/api/Support/ReservationReportSchema.cs new file mode 100644 index 000000000000..602a16b61674 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/ReservationReportSchema.cs @@ -0,0 +1,118 @@ +// 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.Cost.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.Cost.Support.ReservationReportSchema InstanceFlexibilityGroup = @"InstanceFlexibilityGroup"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema InstanceFlexibilityRatio = @"InstanceFlexibilityRatio"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema InstanceId = @"InstanceId"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema Kind = @"Kind"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema ReservationId = @"ReservationId"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema ReservationOrderId = @"ReservationOrderId"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema ReservedHours = @"ReservedHours"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema SkuName = @"SkuName"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema TotalReservedQuantity = @"TotalReservedQuantity"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema UsageDate = @"UsageDate"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.ReservationReportSchema e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.ReservationReportSchema e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ReservationReportSchema e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/StatusType.Completer.cs b/swaggerci/cost-management/generated/api/Support/StatusType.Completer.cs new file mode 100644 index 000000000000..b502ec4e5990 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/StatusType.Completer.cs @@ -0,0 +1,41 @@ +// 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.Cost.Support +{ + + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.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/swaggerci/cost-management/generated/api/Support/StatusType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/StatusType.TypeConverter.cs new file mode 100644 index 000000000000..d135c4e7b979 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/StatusType.TypeConverter.cs @@ -0,0 +1,61 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/StatusType.cs b/swaggerci/cost-management/generated/api/Support/StatusType.cs new file mode 100644 index 000000000000..e09951c87f03 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/StatusType.cs @@ -0,0 +1,100 @@ +// 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.Cost.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.Cost.Support.StatusType Active = @"Active"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.StatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.StatusType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/api/Support/TimeframeType.Completer.cs b/swaggerci/cost-management/generated/api/Support/TimeframeType.Completer.cs new file mode 100644 index 000000000000..9ae6ebf197f4 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/TimeframeType.Completer.cs @@ -0,0 +1,57 @@ +// 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.Cost.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.Cost.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/swaggerci/cost-management/generated/api/Support/TimeframeType.TypeConverter.cs b/swaggerci/cost-management/generated/api/Support/TimeframeType.TypeConverter.cs new file mode 100644 index 000000000000..bd5a8abae2d7 --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/TimeframeType.TypeConverter.cs @@ -0,0 +1,61 @@ +// 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.Cost.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/swaggerci/cost-management/generated/api/Support/TimeframeType.cs b/swaggerci/cost-management/generated/api/Support/TimeframeType.cs new file mode 100644 index 000000000000..a8b16e45eb7a --- /dev/null +++ b/swaggerci/cost-management/generated/api/Support/TimeframeType.cs @@ -0,0 +1,108 @@ +// 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.Cost.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.Cost.Support.TimeframeType BillingMonthToDate = @"BillingMonthToDate"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType Custom = @"Custom"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType MonthToDate = @"MonthToDate"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType TheLastBillingMonth = @"TheLastBillingMonth"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType TheLastMonth = @"TheLastMonth"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.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.Cost.Support.TimeframeType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.TimeframeType e1, Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostAlertExternal_List.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostAlertExternal_List.cs new file mode 100644 index 000000000000..19c02bdcfd49 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostAlertExternal_List.cs @@ -0,0 +1,411 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the Alerts for external cloud provider type defined. + /// + /// [OpenAPI] ListExternal=>GET:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostAlertExternal_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the Alerts for external cloud provider type defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostAlertExternal_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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 flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _externalCloudProviderId; + + /// + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used + /// with dimension/query operations. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", + SerializedName = @"externalCloudProviderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string ExternalCloudProviderId { get => this._externalCloudProviderId; set => this._externalCloudProviderId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType _externalCloudProviderType; + + /// + /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for + /// linked account and 'externalBillingAccounts' for consolidated account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.ExternalCloudProviderType) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType ExternalCloudProviderType { get => this._externalCloudProviderType; set => this._externalCloudProviderType = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IAlertsResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostAlertExternal_List() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsListExternal(ExternalCloudProviderType, ExternalCloudProviderId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ExternalCloudProviderType=ExternalCloudProviderType,ExternalCloudProviderId=ExternalCloudProviderId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId }) + { + 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 { ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId }) + { + 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.Cost.Models.Api20211001.IAlertsResult + /// 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 + // response should be returning an array of some kind. +Pageable + // nested-array / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsListExternal_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostAlert_Get.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostAlert_Get.cs new file mode 100644 index 000000000000..b370e9eb9393 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostAlert_Get.cs @@ -0,0 +1,393 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Gets the alert for the scope by alert ID. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostAlert_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Gets the alert for the scope by alert ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostAlert_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// Alert ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Alert ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Alert ID", + SerializedName = @"alertId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AlertId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + /// specific for partners. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostAlert_Get() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsGet(Scope, Id, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Id=Id}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Id=Id }) + { + 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, Id=Id }) + { + 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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Models.Api20211001.IAlert + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostAlert_GetViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostAlert_GetViaIdentity.cs new file mode 100644 index 000000000000..99ceeb59ef32 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostAlert_GetViaIdentity.cs @@ -0,0 +1,378 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Gets the alert for the scope by alert ID. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostAlert_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Gets the alert for the scope by alert ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostAlert_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostAlert_GetViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AlertsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AlertId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AlertId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AlertsGet(InputObject.Scope ?? null, InputObject.AlertId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Models.Api20211001.IAlert + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostAlert_List.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostAlert_List.cs new file mode 100644 index 000000000000..e6f9fa03e8b0 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostAlert_List.cs @@ -0,0 +1,400 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the alerts for scope defined. + /// + /// [OpenAPI] List=>GET:"/{scope}/providers/Microsoft.CostManagement/alerts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostAlert_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlertsResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the alerts for scope defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostAlert_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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 flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + /// specific for partners. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IAlertsResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostAlert_List() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsList(Scope, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope }) + { + 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 }) + { + 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.Cost.Models.Api20211001.IAlertsResult + /// 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 + // response should be returning an array of some kind. +Pageable + // nested-array / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostDimension_List.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostDimension_List.cs new file mode 100644 index 000000000000..5889fb44e5ce --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostDimension_List.cs @@ -0,0 +1,485 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the dimensions by the defined scope. + /// + /// [OpenAPI] List=>GET:"/{scope}/providers/Microsoft.CostManagement/dimensions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostDimension_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the dimensions by the defined scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostDimension_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators + /// are 'eq','lt', 'gt', 'le', 'ge'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Backing field for property. + private string _skiptoken; + + /// + /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + /// the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent + /// calls. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$skiptoken", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Skiptoken { get => this._skiptoken; set => this._skiptoken = value; } + + /// Backing field for property. + private int _top; + + /// May be used to limit the number of results to the most recent N dimension data. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to limit the number of results to the most recent N dimension data.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to limit the number of results to the most recent N dimension data.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.IDimensionsListResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostDimension_List() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DimensionsList(Scope, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null,Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + 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, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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.Cost.Models.Api20211001.IDimensionsListResult + /// 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostExportExecutionHistory_Get.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostExportExecutionHistory_Get.cs new file mode 100644 index 000000000000..5461a3ce3a02 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostExportExecutionHistory_Get.cs @@ -0,0 +1,395 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// The operation to get the execution history of an export for the defined scope and export name. + /// + /// + /// [OpenAPI] GetExecutionHistory=>GET:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostExportExecutionHistory_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to get the execution history of an export for the defined scope and export name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostExportExecutionHistory_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _exportName; + + /// Export Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Export Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Export Name.", + SerializedName = @"exportName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string ExportName { get => this._exportName; set => this._exportName = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostExportExecutionHistory_Get() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsGetExecutionHistory(Scope, ExportName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.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) + { + 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 + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostExportExecutionHistory_GetViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostExportExecutionHistory_GetViaIdentity.cs new file mode 100644 index 000000000000..91e4504d0f09 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostExportExecutionHistory_GetViaIdentity.cs @@ -0,0 +1,381 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// The operation to get the execution history of an export for the defined scope and export name. + /// + /// + /// [OpenAPI] GetExecutionHistory=>GET:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostExportExecutionHistory_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExportExecution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to get the execution history of an export for the defined scope and export name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostExportExecutionHistory_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostExportExecutionHistory_GetViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ExportsGetExecutionHistoryViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExportName) + { + 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.ExportsGetExecutionHistory(InputObject.Scope ?? null, InputObject.ExportName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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.Cost.Models.Api20211001.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) + { + 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 + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostExport_Get.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostExport_Get.cs new file mode 100644 index 000000000000..c7b61f3f1cfd --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostExport_Get.cs @@ -0,0 +1,410 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to get the export for the defined scope by export name. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostExport_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to get the export for the defined scope by export name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostExport_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostExport_Get() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsGet(Scope, Name, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IExport + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostExport_GetViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostExport_GetViaIdentity.cs new file mode 100644 index 000000000000..cb73cc18d1a9 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostExport_GetViaIdentity.cs @@ -0,0 +1,395 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to get the export for the defined scope by export name. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostExport_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to get the export for the defined scope by export name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostExport_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostExport_GetViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ExportsGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExportName) + { + 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.ExportsGet(InputObject.Scope ?? null, InputObject.ExportName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IExport + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostExport_List.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostExport_List.cs new file mode 100644 index 000000000000..a9bb7a279570 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostExport_List.cs @@ -0,0 +1,396 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to list all exports at the given scope. + /// + /// [OpenAPI] List=>GET:"/{scope}/providers/Microsoft.CostManagement/exports" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostExport_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to list all exports at the given scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostExport_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostExport_List() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsList(Scope, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.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) + { + 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 + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateCostDetailReportOperationResult_Get.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateCostDetailReportOperationResult_Get.cs new file mode 100644 index 000000000000..993951494ecb --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateCostDetailReportOperationResult_Get.cs @@ -0,0 +1,459 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// Get the result of the specified operation. This link is provided in the CostDetails creation request response Location + /// header. + /// + /// + /// [OpenAPI] GetOperationResults=>GET:"/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostGenerateCostDetailReportOperationResult_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Get the result of the specified operation. This link is provided in the CostDetails creation request response Location header.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostGenerateCostDetailReportOperationResult_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _operationId; + + /// The target operation Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The target operation Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The target operation Id.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20220501.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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of GetAzCostGenerateCostDetailReportOperationResult_Get + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Cmdlets.GetAzCostGenerateCostDetailReportOperationResult_Get Clone() + { + var clone = new GetAzCostGenerateCostDetailReportOperationResult_Get(); + 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.OperationId = this.OperationId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostGenerateCostDetailReportOperationResult_Get() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.Cost.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GenerateCostDetailsReportGetOperationResults(Scope, OperationId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,OperationId=OperationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, OperationId=OperationId }) + { + 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, OperationId=OperationId }) + { + 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.Cost.Models.Api20220501.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.Cost.Models.Api20220501.ICostDetailsOperationResults + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateCostDetailReportOperationResult_GetViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateCostDetailReportOperationResult_GetViaIdentity.cs new file mode 100644 index 000000000000..ac4a1845603b --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateCostDetailReportOperationResult_GetViaIdentity.cs @@ -0,0 +1,447 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// Get the result of the specified operation. This link is provided in the CostDetails creation request response Location + /// header. + /// + /// + /// [OpenAPI] GetOperationResults=>GET:"/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostGenerateCostDetailReportOperationResult_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Get the result of the specified operation. This link is provided in the CostDetails creation request response Location header.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostGenerateCostDetailReportOperationResult_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20220501.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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of GetAzCostGenerateCostDetailReportOperationResult_GetViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Cmdlets.GetAzCostGenerateCostDetailReportOperationResult_GetViaIdentity Clone() + { + var clone = new GetAzCostGenerateCostDetailReportOperationResult_GetViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzCostGenerateCostDetailReportOperationResult_GetViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.Cost.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.GenerateCostDetailsReportGetOperationResultsViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.OperationId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.OperationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.GenerateCostDetailsReportGetOperationResults(InputObject.Scope ?? null, InputObject.OperationId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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.Cost.Models.Api20220501.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.Cost.Models.Api20220501.ICostDetailsOperationResults + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationResult_Get.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationResult_Get.cs new file mode 100644 index 000000000000..4d5cab0deb49 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationResult_Get.cs @@ -0,0 +1,435 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// Get the result of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response + /// header. + /// + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostGenerateDetailedCostReportOperationResult_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Get the result of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostGenerateDetailedCostReportOperationResult_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _operationId; + + /// The target operation Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The target operation Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The target operation Id.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// overrideOnAccepted will be called before the regular onAccepted 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. + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostGenerateDetailedCostReportOperationResult_Get() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GenerateDetailedCostReportOperationResultsGet(OperationId, Scope, onOk, onAccepted, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OperationId=OperationId,Scope=Scope}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 202 (Accepted). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OperationId=OperationId, Scope=Scope }) + { + 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 { OperationId=OperationId, Scope=Scope }) + { + 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationResult_GetViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationResult_GetViaIdentity.cs new file mode 100644 index 000000000000..84e2240135e0 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationResult_GetViaIdentity.cs @@ -0,0 +1,423 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// Get the result of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response + /// header. + /// + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostGenerateDetailedCostReportOperationResult_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Get the result of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostGenerateDetailedCostReportOperationResult_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnAccepted will be called before the regular onAccepted 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. + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzCostGenerateDetailedCostReportOperationResult_GetViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.GenerateDetailedCostReportOperationResultsGetViaIdentity(InputObject.Id, onOk, onAccepted, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.OperationId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.OperationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.GenerateDetailedCostReportOperationResultsGet(InputObject.OperationId ?? null, InputObject.Scope ?? null, onOk, onAccepted, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 202 (Accepted). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationStatus_Get.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationStatus_Get.cs new file mode 100644 index 000000000000..baf0c81c7486 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationStatus_Get.cs @@ -0,0 +1,394 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response + /// header. + /// + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostGenerateDetailedCostReportOperationStatus_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostGenerateDetailedCostReportOperationStatus_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _operationId; + + /// The target operation Id. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The target operation Id.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The target operation Id.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostGenerateDetailedCostReportOperationStatus_Get() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GenerateDetailedCostReportOperationStatusGet(OperationId, Scope, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OperationId=OperationId,Scope=Scope}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OperationId=OperationId, Scope=Scope }) + { + 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 { OperationId=OperationId, Scope=Scope }) + { + 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationStatus_GetViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationStatus_GetViaIdentity.cs new file mode 100644 index 000000000000..7f735a08099c --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostGenerateDetailedCostReportOperationStatus_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response + /// header. + /// + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostGenerateDetailedCostReportOperationStatus_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostGenerateDetailedCostReportOperationStatus_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzCostGenerateDetailedCostReportOperationStatus_GetViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.GenerateDetailedCostReportOperationStatusGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.OperationId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.OperationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.GenerateDetailedCostReportOperationStatusGet(InputObject.OperationId ?? null, InputObject.Scope ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationStatuses + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostOperation_List.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostOperation_List.cs new file mode 100644 index 000000000000..34088b068b58 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostOperation_List.cs @@ -0,0 +1,377 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists all of the available cost management REST API operations. + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.CostManagement/operations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostOperation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists all of the available cost management REST API operations.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostOperation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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 flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostOperation_List() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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.Cost.Models.Api20211001.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) + { + 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostView_Get.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_Get.cs new file mode 100644 index 000000000000..37f0fa99d702 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_Get.cs @@ -0,0 +1,367 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Gets the view by view name. + /// + /// [OpenAPI] Get=>GET:"/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostView_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Gets the view by view name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostView_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// View name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "View name")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"View name", + SerializedName = @"viewName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ViewName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IView + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Intializes a new instance of the cmdlet class. + public GetAzCostView_Get() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsGet(Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name }) + { + 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 { Name=Name }) + { + 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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostView_Get1.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_Get1.cs new file mode 100644 index 000000000000..090db32fae10 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_Get1.cs @@ -0,0 +1,393 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Gets the view for the defined scope by view name. + /// + /// [OpenAPI] GetByScope=>GET:"/{scope}/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostView_Get1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Gets the view for the defined scope by view name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostView_Get1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// View name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "View name")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"View name", + SerializedName = @"viewName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ViewName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IView + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostView_Get1() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsGetByScope(Scope, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostView_GetViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_GetViaIdentity.cs new file mode 100644 index 000000000000..44ea46e36ffd --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_GetViaIdentity.cs @@ -0,0 +1,374 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Gets the view by view name. + /// + /// [OpenAPI] Get=>GET:"/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostView_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Gets the view by view name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostView_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IView + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostView_GetViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ViewsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ViewName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ViewName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ViewsGet(InputObject.ViewName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostView_GetViaIdentity1.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_GetViaIdentity1.cs new file mode 100644 index 000000000000..92190c520cc3 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_GetViaIdentity1.cs @@ -0,0 +1,378 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Gets the view for the defined scope by view name. + /// + /// [OpenAPI] GetByScope=>GET:"/{scope}/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostView_GetViaIdentity1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Gets the view for the defined scope by view name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostView_GetViaIdentity1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IView + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostView_GetViaIdentity1() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ViewsGetByScopeViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ViewName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ViewName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ViewsGetByScope(InputObject.Scope ?? null, InputObject.ViewName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostView_List.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_List.cs new file mode 100644 index 000000000000..77c422b713d5 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_List.cs @@ -0,0 +1,376 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists all views by tenant and object. + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.CostManagement/views" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostView_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists all views by tenant and object.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostView_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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 flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IViewListResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostView_List() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsList(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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.Cost.Models.Api20211001.IViewListResult + /// 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/GetAzCostView_List1.cs b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_List1.cs new file mode 100644 index 000000000000..7a3d4daa0459 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/GetAzCostView_List1.cs @@ -0,0 +1,400 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists all views at the given scope. + /// + /// [OpenAPI] ListByScope=>GET:"/{scope}/providers/Microsoft.CostManagement/views" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzCostView_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists all views at the given scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class GetAzCostView_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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 flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IViewListResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzCostView_List1() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsListByScope(Scope, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope }) + { + 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 }) + { + 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.Cost.Models.Api20211001.IViewListResult + /// 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsListByScope_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByDimensionExternalCloudProviderType_By.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByDimensionExternalCloudProviderType_By.cs new file mode 100644 index 000000000000..0e85f37dec12 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByDimensionExternalCloudProviderType_By.cs @@ -0,0 +1,455 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the dimensions by the external cloud provider type. + /// + /// [OpenAPI] ByExternalCloudProviderType=>GET:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostByDimensionExternalCloudProviderType_By")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the dimensions by the external cloud provider type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostByDimensionExternalCloudProviderType_By : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Backing field for property. + private string _externalCloudProviderId; + + /// + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used + /// with dimension/query operations. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", + SerializedName = @"externalCloudProviderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string ExternalCloudProviderId { get => this._externalCloudProviderId; set => this._externalCloudProviderId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType _externalCloudProviderType; + + /// + /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for + /// linked account and 'externalBillingAccounts' for consolidated account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.ExternalCloudProviderType) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType ExternalCloudProviderType { get => this._externalCloudProviderType; set => this._externalCloudProviderType = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators + /// are 'eq','lt', 'gt', 'le', 'ge'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _skiptoken; + + /// + /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + /// the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent + /// calls. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$skiptoken", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Skiptoken { get => this._skiptoken; set => this._skiptoken = value; } + + /// Backing field for property. + private int _top; + + /// May be used to limit the number of results to the most recent N dimension data. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to limit the number of results to the most recent N dimension data.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to limit the number of results to the most recent N dimension data.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IDimensionsListResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostByDimensionExternalCloudProviderType_By() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DimensionsByExternalCloudProviderType(ExternalCloudProviderType, ExternalCloudProviderId, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ExternalCloudProviderType=ExternalCloudProviderType,ExternalCloudProviderId=ExternalCloudProviderId,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null,Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + 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 { ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + 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.Cost.Models.Api20211001.IDimensionsListResult + /// 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByDimensionExternalCloudProviderType_ByViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByDimensionExternalCloudProviderType_ByViaIdentity.cs new file mode 100644 index 000000000000..03ebd389dd3a --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByDimensionExternalCloudProviderType_ByViaIdentity.cs @@ -0,0 +1,445 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the dimensions by the external cloud provider type. + /// + /// [OpenAPI] ByExternalCloudProviderType=>GET:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostByDimensionExternalCloudProviderType_ByViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDimension))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the dimensions by the external cloud provider type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostByDimensionExternalCloudProviderType_ByViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators + /// are 'eq','lt', 'gt', 'le', 'ge'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _skiptoken; + + /// + /// Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + /// the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent + /// calls. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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.", + SerializedName = @"$skiptoken", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Skiptoken { get => this._skiptoken; set => this._skiptoken = value; } + + /// Backing field for property. + private int _top; + + /// May be used to limit the number of results to the most recent N dimension data. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to limit the number of results to the most recent N dimension data.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to limit the number of results to the most recent N dimension data.", + SerializedName = @"$top", + PossibleTypes = new [] { typeof(int) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public int Top { get => this._top; set => this._top = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IDimensionsListResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzCostByDimensionExternalCloudProviderType_ByViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DimensionsByExternalCloudProviderTypeViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ExternalCloudProviderType) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderType"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExternalCloudProviderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DimensionsByExternalCloudProviderType(InputObject.ExternalCloudProviderType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType)""), InputObject.ExternalCloudProviderId ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?), onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null,Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?)}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : null, Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(int?) }) + { + 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.Cost.Models.Api20211001.IDimensionsListResult + /// 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 + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingAccountId_By.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingAccountId_By.cs new file mode 100644 index 000000000000..58e6be3aca9c --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingAccountId_By.cs @@ -0,0 +1,471 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// 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 + /// + /// + /// [OpenAPI] ByBillingAccountId=>POST:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostByGenerateReservationDetailReportBillingAccountId_By", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Generated] + public partial class InvokeAzCostByGenerateReservationDetailReportBillingAccountId_By : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _billingAccountId; + + /// Enrollment ID (Legacy BillingAccount ID) + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Enrollment ID (Legacy BillingAccount ID)")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Enrollment ID (Legacy BillingAccount ID)", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string BillingAccountId { get => this._billingAccountId; set => this._billingAccountId = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _endDate; + + /// End Date + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "End Date")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"End Date", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string EndDate { get => this._endDate; set => this._endDate = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _startDate; + + /// Start Date + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Start Date")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Start Date", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string StartDate { get => this._startDate; set => this._startDate = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzCostByGenerateReservationDetailReportBillingAccountId_By + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Cmdlets.InvokeAzCostByGenerateReservationDetailReportBillingAccountId_By Clone() + { + var clone = new InvokeAzCostByGenerateReservationDetailReportBillingAccountId_By(); + 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.BillingAccountId = this.BillingAccountId; + clone.StartDate = this.StartDate; + clone.EndDate = this.EndDate; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzCostByGenerateReservationDetailReportBillingAccountId_By() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.Cost.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GenerateReservationDetailsReportByBillingAccountId' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GenerateReservationDetailsReportByBillingAccountId(BillingAccountId, StartDate, EndDate, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.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) + { + 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.Cost.Models.Api20211001.IOperationStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity.cs new file mode 100644 index 000000000000..e9c991d0ba6b --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity.cs @@ -0,0 +1,476 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// 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 + /// + /// + /// [OpenAPI] ByBillingAccountId=>POST:"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Generated] + public partial class InvokeAzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _endDate; + + /// End Date + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "End Date")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"End Date", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string EndDate { get => this._endDate; set => this._endDate = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _startDate; + + /// Start Date + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Start Date")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Start Date", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string StartDate { get => this._startDate; set => this._startDate = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Cmdlets.InvokeAzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity Clone() + { + var clone = new InvokeAzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity(); + 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.StartDate = this.StartDate; + clone.EndDate = this.EndDate; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostByGenerateReservationDetailReportBillingAccountId_ByViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.Cost.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GenerateReservationDetailsReportByBillingAccountId' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.GenerateReservationDetailsReportByBillingAccountIdViaIdentity(InputObject.Id, StartDate, EndDate, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.BillingAccountId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BillingAccountId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.GenerateReservationDetailsReportByBillingAccountId(InputObject.BillingAccountId ?? null, StartDate, EndDate, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { StartDate=StartDate,EndDate=EndDate}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { StartDate=StartDate, EndDate=EndDate }) + { + 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 { StartDate=StartDate, EndDate=EndDate }) + { + 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.Cost.Models.Api20211001.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) + { + 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.Cost.Models.Api20211001.IOperationStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingProfileId_By.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingProfileId_By.cs new file mode 100644 index 000000000000..4fcfaa867650 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingProfileId_By.cs @@ -0,0 +1,486 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// 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 + /// + /// + /// [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, @"AzCostByGenerateReservationDetailReportBillingProfileId_By", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Generated] + public partial class InvokeAzCostByGenerateReservationDetailReportBillingProfileId_By : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _billingAccountId; + + /// BillingAccount ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingAccount ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingAccount ID", + SerializedName = @"billingAccountId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string BillingAccountId { get => this._billingAccountId; set => this._billingAccountId = value; } + + /// Backing field for property. + private string _billingProfileId; + + /// BillingProfile ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "BillingProfile ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"BillingProfile ID", + SerializedName = @"billingProfileId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string BillingProfileId { get => this._billingProfileId; set => this._billingProfileId = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _endDate; + + /// End Date + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "End Date")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"End Date", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string EndDate { get => this._endDate; set => this._endDate = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _startDate; + + /// Start Date + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Start Date")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Start Date", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string StartDate { get => this._startDate; set => this._startDate = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzCostByGenerateReservationDetailReportBillingProfileId_By + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Cmdlets.InvokeAzCostByGenerateReservationDetailReportBillingProfileId_By Clone() + { + var clone = new InvokeAzCostByGenerateReservationDetailReportBillingProfileId_By(); + 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.BillingAccountId = this.BillingAccountId; + clone.BillingProfileId = this.BillingProfileId; + clone.StartDate = this.StartDate; + clone.EndDate = this.EndDate; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzCostByGenerateReservationDetailReportBillingProfileId_By() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.Cost.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GenerateReservationDetailsReportByBillingProfileId' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GenerateReservationDetailsReportByBillingProfileId(BillingAccountId, BillingProfileId, StartDate, EndDate, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.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) + { + 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.Cost.Models.Api20211001.IOperationStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity.cs new file mode 100644 index 000000000000..82edc84a93b1 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity.cs @@ -0,0 +1,480 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// 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 + /// + /// + /// [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, @"AzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperationStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Generated] + public partial class InvokeAzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _endDate; + + /// End Date + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "End Date")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"End Date", + SerializedName = @"endDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string EndDate { get => this._endDate; set => this._endDate = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _startDate; + + /// Start Date + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Start Date")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Start Date", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string StartDate { get => this._startDate; set => this._startDate = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Cmdlets.InvokeAzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity Clone() + { + var clone = new InvokeAzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity(); + 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.StartDate = this.StartDate; + clone.EndDate = this.EndDate; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostByGenerateReservationDetailReportBillingProfileId_ByViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.Cost.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GenerateReservationDetailsReportByBillingProfileId' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.GenerateReservationDetailsReportByBillingProfileIdViaIdentity(InputObject.Id, StartDate, EndDate, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.BillingAccountId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BillingAccountId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.BillingProfileId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BillingProfileId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.GenerateReservationDetailsReportByBillingProfileId(InputObject.BillingAccountId ?? null, InputObject.BillingProfileId ?? null, StartDate, EndDate, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { StartDate=StartDate,EndDate=EndDate}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { StartDate=StartDate, EndDate=EndDate }) + { + 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 { StartDate=StartDate, EndDate=EndDate }) + { + 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.Cost.Models.Api20211001.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) + { + 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.Cost.Models.Api20211001.IOperationStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_Cloud.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_Cloud.cs new file mode 100644 index 000000000000..2620ca3bcd6a --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_Cloud.cs @@ -0,0 +1,422 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the forecast charges for external cloud provider type defined. + /// + /// [OpenAPI] ExternalCloudProviderUsage=>POST:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostCloudForecast_Cloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the forecast charges for external cloud provider type defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostCloudForecast_Cloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _externalCloudProviderId; + + /// + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used + /// with dimension/query operations. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", + SerializedName = @"externalCloudProviderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string ExternalCloudProviderId { get => this._externalCloudProviderId; set => this._externalCloudProviderId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType _externalCloudProviderType; + + /// + /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for + /// linked account and 'externalBillingAccounts' for consolidated account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.ExternalCloudProviderType) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType ExternalCloudProviderType { get => this._externalCloudProviderType; set => this._externalCloudProviderType = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition _parameter; + + /// The definition of a forecast. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The definition of a forecast.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The definition of a forecast.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostCloudForecast_Cloud() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ForecastExternalCloudProviderUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ForecastExternalCloudProviderUsage(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ExternalCloudProviderType, ExternalCloudProviderId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,ExternalCloudProviderType=ExternalCloudProviderType,ExternalCloudProviderId=ExternalCloudProviderId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, body=Parameter }) + { + 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, body=Parameter }) + { + 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Models.Api20211001.IForecastResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_CloudExpanded.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_CloudExpanded.cs new file mode 100644 index 000000000000..fae4722acd38 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_CloudExpanded.cs @@ -0,0 +1,580 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the forecast charges for external cloud provider type defined. + /// + /// [OpenAPI] ExternalCloudProviderUsage=>POST:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostCloudForecast_CloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the forecast charges for external cloud provider type defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostCloudForecast_CloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a forecast. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = 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. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Models.Api20211001.IForecastDatasetAggregation) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation DatasetAggregation { get => _parametersBody.DatasetAggregation ?? null /* object */; set => _parametersBody.DatasetAggregation = value; } + + /// The granularity of rows in the forecast. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the forecast.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the forecast.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType DatasetGranularity { get => _parametersBody.DatasetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); set => _parametersBody.DatasetGranularity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string DimensionName { get => _parametersBody.DimensionName ?? null; set => _parametersBody.DimensionName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] DimensionValue { get => _parametersBody.DimensionValue ?? null /* arrayOf */; set => _parametersBody.DimensionValue = value; } + + /// Backing field for property. + private string _externalCloudProviderId; + + /// + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used + /// with dimension/query operations. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", + SerializedName = @"externalCloudProviderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string ExternalCloudProviderId { get => this._externalCloudProviderId; set => this._externalCloudProviderId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType _externalCloudProviderType; + + /// + /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for + /// linked account and 'externalBillingAccounts' for consolidated account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.ExternalCloudProviderType) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType ExternalCloudProviderType { get => this._externalCloudProviderType; set => this._externalCloudProviderType = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"AND\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get => _parametersBody.FilterAnd ?? null /* arrayOf */; set => _parametersBody.FilterAnd = value; } + + /// The logical "OR" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"OR\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get => _parametersBody.FilterOr ?? null /* arrayOf */; set => _parametersBody.FilterOr = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// A boolean determining if actualCost will be included. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean determining if actualCost will be included.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if actualCost will be included.", + SerializedName = @"includeActualCost", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IncludeActualCost { get => _parametersBody.IncludeActualCost ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IncludeActualCost = value; } + + /// A boolean determining if FreshPartialCost will be included. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean determining if FreshPartialCost will be included.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if FreshPartialCost will be included.", + SerializedName = @"includeFreshPartialCost", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IncludeFreshPartialCost { get => _parametersBody.IncludeFreshPartialCost ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IncludeFreshPartialCost = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string TagName { get => _parametersBody.TagName ?? null; set => _parametersBody.TagName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] TagValue { get => _parametersBody.TagValue ?? null /* arrayOf */; set => _parametersBody.TagValue = value; } + + /// The start date to pull data from. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodFrom { get => _parametersBody.TimePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.TimePeriodFrom = value; } + + /// The end date to pull data to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodTo { get => _parametersBody.TimePeriodTo ?? default(global::System.DateTime); set => _parametersBody.TimePeriodTo = value; } + + /// The type of the forecast. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the forecast.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the forecast.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType Type { get => _parametersBody.Type; set => _parametersBody.Type = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostCloudForecast_CloudExpanded() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ForecastExternalCloudProviderUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ForecastExternalCloudProviderUsage(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ExternalCloudProviderType, ExternalCloudProviderId, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,ExternalCloudProviderType=ExternalCloudProviderType,ExternalCloudProviderId=ExternalCloudProviderId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, body=_parametersBody }) + { + 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, body=_parametersBody }) + { + 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Models.Api20211001.IForecastResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_CloudViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_CloudViaIdentity.cs new file mode 100644 index 000000000000..63131ffe01cf --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_CloudViaIdentity.cs @@ -0,0 +1,411 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the forecast charges for external cloud provider type defined. + /// + /// [OpenAPI] ExternalCloudProviderUsage=>POST:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostCloudForecast_CloudViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the forecast charges for external cloud provider type defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostCloudForecast_CloudViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition _parameter; + + /// The definition of a forecast. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The definition of a forecast.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The definition of a forecast.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostCloudForecast_CloudViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ForecastExternalCloudProviderUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ForecastExternalCloudProviderUsageViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ExternalCloudProviderType) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderType"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExternalCloudProviderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ForecastExternalCloudProviderUsage(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, InputObject.ExternalCloudProviderType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType)""), InputObject.ExternalCloudProviderId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, body=Parameter }) + { + 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, body=Parameter }) + { + 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Models.Api20211001.IForecastResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_CloudViaIdentityExpanded.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_CloudViaIdentityExpanded.cs new file mode 100644 index 000000000000..2e2a91a38417 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostCloudForecast_CloudViaIdentityExpanded.cs @@ -0,0 +1,569 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the forecast charges for external cloud provider type defined. + /// + /// [OpenAPI] ExternalCloudProviderUsage=>POST:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostCloudForecast_CloudViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the forecast charges for external cloud provider type defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostCloudForecast_CloudViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a forecast. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = 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. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Models.Api20211001.IForecastDatasetAggregation) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation DatasetAggregation { get => _parametersBody.DatasetAggregation ?? null /* object */; set => _parametersBody.DatasetAggregation = value; } + + /// The granularity of rows in the forecast. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the forecast.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the forecast.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType DatasetGranularity { get => _parametersBody.DatasetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); set => _parametersBody.DatasetGranularity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string DimensionName { get => _parametersBody.DimensionName ?? null; set => _parametersBody.DimensionName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] DimensionValue { get => _parametersBody.DimensionValue ?? null /* arrayOf */; set => _parametersBody.DimensionValue = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"AND\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get => _parametersBody.FilterAnd ?? null /* arrayOf */; set => _parametersBody.FilterAnd = value; } + + /// The logical "OR" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"OR\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get => _parametersBody.FilterOr ?? null /* arrayOf */; set => _parametersBody.FilterOr = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// A boolean determining if actualCost will be included. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean determining if actualCost will be included.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if actualCost will be included.", + SerializedName = @"includeActualCost", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IncludeActualCost { get => _parametersBody.IncludeActualCost ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IncludeActualCost = value; } + + /// A boolean determining if FreshPartialCost will be included. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean determining if FreshPartialCost will be included.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if FreshPartialCost will be included.", + SerializedName = @"includeFreshPartialCost", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IncludeFreshPartialCost { get => _parametersBody.IncludeFreshPartialCost ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IncludeFreshPartialCost = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string TagName { get => _parametersBody.TagName ?? null; set => _parametersBody.TagName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] TagValue { get => _parametersBody.TagValue ?? null /* arrayOf */; set => _parametersBody.TagValue = value; } + + /// The start date to pull data from. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodFrom { get => _parametersBody.TimePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.TimePeriodFrom = value; } + + /// The end date to pull data to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodTo { get => _parametersBody.TimePeriodTo ?? default(global::System.DateTime); set => _parametersBody.TimePeriodTo = value; } + + /// The type of the forecast. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the forecast.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the forecast.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType Type { get => _parametersBody.Type; set => _parametersBody.Type = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostCloudForecast_CloudViaIdentityExpanded() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ForecastExternalCloudProviderUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ForecastExternalCloudProviderUsageViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ExternalCloudProviderType) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderType"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExternalCloudProviderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ForecastExternalCloudProviderUsage(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, InputObject.ExternalCloudProviderType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType)""), InputObject.ExternalCloudProviderId ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, body=_parametersBody }) + { + 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, body=_parametersBody }) + { + 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Models.Api20211001.IForecastResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_Dismiss.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_Dismiss.cs new file mode 100644 index 000000000000..bed637063596 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_Dismiss.cs @@ -0,0 +1,408 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Dismisses the specified alert + /// + /// [OpenAPI] Dismiss=>PATCH:"/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostDismissAlert_Dismiss", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Dismisses the specified alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostDismissAlert_Dismiss : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// Backing field for property. + private string _alertId; + + /// Alert ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Alert ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Alert ID", + SerializedName = @"alertId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string AlertId { get => this._alertId; set => this._alertId = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload _parameter; + + /// The request payload to update an alert + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request payload to update an alert", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The request payload to update an alert", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + /// specific for partners. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostDismissAlert_Dismiss() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsDismiss' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsDismiss(Scope, AlertId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,AlertId=AlertId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, AlertId=AlertId, body=Parameter }) + { + 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, AlertId=AlertId, body=Parameter }) + { + 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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Models.Api20211001.IAlert + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_DismissExpanded.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_DismissExpanded.cs new file mode 100644 index 000000000000..30ddca6eb154 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_DismissExpanded.cs @@ -0,0 +1,785 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Dismisses the specified alert + /// + /// [OpenAPI] Dismiss=>PATCH:"/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostDismissAlert_DismissExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Dismisses the specified alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostDismissAlert_DismissExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The request payload to update an alert + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DismissAlertPayload(); + + /// Backing field for property. + private string _alertId; + + /// Alert ID + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Alert ID")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Alert ID", + SerializedName = @"alertId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string AlertId { get => this._alertId; set => this._alertId = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// dateTime in which alert was closed + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "dateTime in which alert was closed")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was closed", + SerializedName = @"closeTime", + PossibleTypes = new [] { typeof(string) })] + public string CloseTime { get => _parametersBody.CloseTime ?? null; set => _parametersBody.CloseTime = value; } + + /// related budget + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "related budget")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"related budget", + SerializedName = @"costEntityId", + PossibleTypes = new [] { typeof(string) })] + public string CostEntityId { get => _parametersBody.CostEntityId ?? null; set => _parametersBody.CostEntityId = value; } + + /// dateTime in which alert was created + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "dateTime in which alert was created")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was created", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(string) })] + public string CreationTime { get => _parametersBody.CreationTime ?? null; set => _parametersBody.CreationTime = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Alert category + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Alert category")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert category", + SerializedName = @"category", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory DefinitionCategory { get => _parametersBody.DefinitionCategory ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory)""); set => _parametersBody.DefinitionCategory = value; } + + /// Criteria that triggered alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Criteria that triggered alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Criteria that triggered alert", + SerializedName = @"criteria", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria DefinitionCriterion { get => _parametersBody.DefinitionCriterion ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria)""); set => _parametersBody.DefinitionCriterion = value; } + + /// type of alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "type of alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"type of alert", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType DefinitionType { get => _parametersBody.DefinitionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType)""); set => _parametersBody.DefinitionType = value; } + + /// Alert description + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Alert description")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _parametersBody.Description ?? null; set => _parametersBody.Description = value; } + + /// budget threshold amount + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "budget threshold amount")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"budget threshold amount", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + public decimal DetailAmount { get => _parametersBody.DetailAmount ?? default(decimal); set => _parametersBody.DetailAmount = value; } + + /// company name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "company name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"company name", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + public string DetailCompanyName { get => _parametersBody.DetailCompanyName ?? null; set => _parametersBody.DetailCompanyName = value; } + + /// list of emails to contact + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "list of emails to contact")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of emails to contact", + SerializedName = @"contactEmails", + PossibleTypes = new [] { typeof(string) })] + public string[] DetailContactEmail { get => _parametersBody.DetailContactEmail ?? null /* arrayOf */; set => _parametersBody.DetailContactEmail = value; } + + /// list of action groups to broadcast to + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "list of action groups to broadcast to")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of action groups to broadcast to", + SerializedName = @"contactGroups", + PossibleTypes = new [] { typeof(string) })] + public string[] DetailContactGroup { get => _parametersBody.DetailContactGroup ?? null /* arrayOf */; set => _parametersBody.DetailContactGroup = value; } + + /// list of contact roles + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "list of contact roles")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of contact roles", + SerializedName = @"contactRoles", + PossibleTypes = new [] { typeof(string) })] + public string[] DetailContactRole { get => _parametersBody.DetailContactRole ?? null /* arrayOf */; set => _parametersBody.DetailContactRole = value; } + + /// current spend + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "current spend")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"current spend", + SerializedName = @"currentSpend", + PossibleTypes = new [] { typeof(decimal) })] + public decimal DetailCurrentSpend { get => _parametersBody.DetailCurrentSpend ?? default(decimal); set => _parametersBody.DetailCurrentSpend = value; } + + /// department name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "department name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"department name", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + public string DetailDepartmentName { get => _parametersBody.DetailDepartmentName ?? null; set => _parametersBody.DetailDepartmentName = value; } + + /// datetime of enrollmentEndDate + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "datetime of enrollmentEndDate")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentEndDate", + SerializedName = @"enrollmentEndDate", + PossibleTypes = new [] { typeof(string) })] + public string DetailEnrollmentEndDate { get => _parametersBody.DetailEnrollmentEndDate ?? null; set => _parametersBody.DetailEnrollmentEndDate = value; } + + /// enrollment number + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "enrollment number")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"enrollment number", + SerializedName = @"enrollmentNumber", + PossibleTypes = new [] { typeof(string) })] + public string DetailEnrollmentNumber { get => _parametersBody.DetailEnrollmentNumber ?? null; set => _parametersBody.DetailEnrollmentNumber = value; } + + /// datetime of enrollmentStartDate + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "datetime of enrollmentStartDate")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentStartDate", + SerializedName = @"enrollmentStartDate", + PossibleTypes = new [] { typeof(string) })] + public string DetailEnrollmentStartDate { get => _parametersBody.DetailEnrollmentStartDate ?? null; set => _parametersBody.DetailEnrollmentStartDate = value; } + + /// invoicing threshold + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "invoicing threshold")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"invoicing threshold", + SerializedName = @"invoicingThreshold", + PossibleTypes = new [] { typeof(decimal) })] + public decimal DetailInvoicingThreshold { get => _parametersBody.DetailInvoicingThreshold ?? default(decimal); set => _parametersBody.DetailInvoicingThreshold = value; } + + /// array of meters to filter by + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "array of meters to filter by")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of meters to filter by", + SerializedName = @"meterFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get => _parametersBody.DetailMeterFilter ?? null /* arrayOf */; set => _parametersBody.DetailMeterFilter = value; } + + /// operator used to compare currentSpend with amount + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "operator used to compare currentSpend with amount")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operator used to compare currentSpend with amount", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator DetailOperator { get => _parametersBody.DetailOperator ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator)""); set => _parametersBody.DetailOperator = value; } + + /// overriding alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "overriding alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"overriding alert", + SerializedName = @"overridingAlert", + PossibleTypes = new [] { typeof(string) })] + public string DetailOverridingAlert { get => _parametersBody.DetailOverridingAlert ?? null; set => _parametersBody.DetailOverridingAlert = value; } + + /// datetime of periodStartDate + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "datetime of periodStartDate")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of periodStartDate", + SerializedName = @"periodStartDate", + PossibleTypes = new [] { typeof(string) })] + public string DetailPeriodStartDate { get => _parametersBody.DetailPeriodStartDate ?? null; set => _parametersBody.DetailPeriodStartDate = value; } + + /// array of resources to filter by + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "array of resources to filter by")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resources to filter by", + SerializedName = @"resourceFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get => _parametersBody.DetailResourceFilter ?? null /* arrayOf */; set => _parametersBody.DetailResourceFilter = value; } + + /// array of resourceGroups to filter by + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "array of resourceGroups to filter by")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resourceGroups to filter by", + SerializedName = @"resourceGroupFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get => _parametersBody.DetailResourceGroupFilter ?? null /* arrayOf */; set => _parametersBody.DetailResourceGroupFilter = value; } + + /// tags to filter by + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "tags to filter by")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"tags to filter by", + SerializedName = @"tagFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny DetailTagFilter { get => _parametersBody.DetailTagFilter ?? null /* object */; set => _parametersBody.DetailTagFilter = value; } + + /// notification threshold percentage as a decimal which activated this alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "notification threshold percentage as a decimal which activated this alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notification threshold percentage as a decimal which activated this alert", + SerializedName = @"threshold", + PossibleTypes = new [] { typeof(decimal) })] + public decimal DetailThreshold { get => _parametersBody.DetailThreshold ?? default(decimal); set => _parametersBody.DetailThreshold = value; } + + /// Type of timegrain cadence + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of timegrain cadence")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of timegrain cadence", + SerializedName = @"timeGrainType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType DetailTimeGrainType { get => _parametersBody.DetailTimeGrainType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType)""); set => _parametersBody.DetailTimeGrainType = value; } + + /// notificationId that triggered this alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "notificationId that triggered this alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notificationId that triggered this alert", + SerializedName = @"triggeredBy", + PossibleTypes = new [] { typeof(string) })] + public string DetailTriggeredBy { get => _parametersBody.DetailTriggeredBy ?? null; set => _parametersBody.DetailTriggeredBy = value; } + + /// unit of currency being used + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "unit of currency being used")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"unit of currency being used", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + public string DetailUnit { get => _parametersBody.DetailUnit ?? null; set => _parametersBody.DetailUnit = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// dateTime in which alert was last modified + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "dateTime in which alert was last modified")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was last modified", + SerializedName = @"modificationTime", + PossibleTypes = new [] { typeof(string) })] + public string ModificationTime { get => _parametersBody.ModificationTime ?? null; set => _parametersBody.ModificationTime = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + /// specific for partners. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Source of alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source of alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source of alert", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource Source { get => _parametersBody.Source ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource)""); set => _parametersBody.Source = value; } + + /// alert status + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "alert status")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"alert status", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus Status { get => _parametersBody.Status ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus)""); set => _parametersBody.Status = value; } + + /// dateTime in which the alert status was last modified + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "dateTime in which the alert status was last modified")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which the alert status was last modified", + SerializedName = @"statusModificationTime", + PossibleTypes = new [] { typeof(string) })] + public string StatusModificationTime { get => _parametersBody.StatusModificationTime ?? null; set => _parametersBody.StatusModificationTime = value; } + + /// User who last modified the alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User who last modified the alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User who last modified the alert", + SerializedName = @"statusModificationUserName", + PossibleTypes = new [] { typeof(string) })] + public string StatusModificationUserName { get => _parametersBody.StatusModificationUserName ?? null; set => _parametersBody.StatusModificationUserName = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostDismissAlert_DismissExpanded() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsDismiss' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AlertsDismiss(Scope, AlertId, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,AlertId=AlertId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, AlertId=AlertId, body=_parametersBody }) + { + 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, AlertId=AlertId, body=_parametersBody }) + { + 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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Models.Api20211001.IAlert + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_DismissViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_DismissViaIdentity.cs new file mode 100644 index 000000000000..ff5d868fd4f7 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_DismissViaIdentity.cs @@ -0,0 +1,394 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Dismisses the specified alert + /// + /// [OpenAPI] Dismiss=>PATCH:"/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostDismissAlert_DismissViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Dismisses the specified alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostDismissAlert_DismissViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload _parameter; + + /// The request payload to update an alert + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request payload to update an alert", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The request payload to update an alert", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostDismissAlert_DismissViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsDismiss' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AlertsDismissViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AlertId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AlertId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AlertsDismiss(InputObject.Scope ?? null, InputObject.AlertId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + 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=Parameter }) + { + 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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Models.Api20211001.IAlert + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_DismissViaIdentityExpanded.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_DismissViaIdentityExpanded.cs new file mode 100644 index 000000000000..a777b12a7512 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostDismissAlert_DismissViaIdentityExpanded.cs @@ -0,0 +1,771 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Dismisses the specified alert + /// + /// [OpenAPI] Dismiss=>PATCH:"/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostDismissAlert_DismissViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IAlert))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Dismisses the specified alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostDismissAlert_DismissViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The request payload to update an alert + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IDismissAlertPayload _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.DismissAlertPayload(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// dateTime in which alert was closed + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "dateTime in which alert was closed")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was closed", + SerializedName = @"closeTime", + PossibleTypes = new [] { typeof(string) })] + public string CloseTime { get => _parametersBody.CloseTime ?? null; set => _parametersBody.CloseTime = value; } + + /// related budget + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "related budget")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"related budget", + SerializedName = @"costEntityId", + PossibleTypes = new [] { typeof(string) })] + public string CostEntityId { get => _parametersBody.CostEntityId ?? null; set => _parametersBody.CostEntityId = value; } + + /// dateTime in which alert was created + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "dateTime in which alert was created")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was created", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(string) })] + public string CreationTime { get => _parametersBody.CreationTime ?? null; set => _parametersBody.CreationTime = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Alert category + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Alert category")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert category", + SerializedName = @"category", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory DefinitionCategory { get => _parametersBody.DefinitionCategory ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCategory)""); set => _parametersBody.DefinitionCategory = value; } + + /// Criteria that triggered alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Criteria that triggered alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Criteria that triggered alert", + SerializedName = @"criteria", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria DefinitionCriterion { get => _parametersBody.DefinitionCriterion ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertCriteria)""); set => _parametersBody.DefinitionCriterion = value; } + + /// type of alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "type of alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"type of alert", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType DefinitionType { get => _parametersBody.DefinitionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertType)""); set => _parametersBody.DefinitionType = value; } + + /// Alert description + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Alert description")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alert description", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _parametersBody.Description ?? null; set => _parametersBody.Description = value; } + + /// budget threshold amount + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "budget threshold amount")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"budget threshold amount", + SerializedName = @"amount", + PossibleTypes = new [] { typeof(decimal) })] + public decimal DetailAmount { get => _parametersBody.DetailAmount ?? default(decimal); set => _parametersBody.DetailAmount = value; } + + /// company name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "company name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"company name", + SerializedName = @"companyName", + PossibleTypes = new [] { typeof(string) })] + public string DetailCompanyName { get => _parametersBody.DetailCompanyName ?? null; set => _parametersBody.DetailCompanyName = value; } + + /// list of emails to contact + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "list of emails to contact")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of emails to contact", + SerializedName = @"contactEmails", + PossibleTypes = new [] { typeof(string) })] + public string[] DetailContactEmail { get => _parametersBody.DetailContactEmail ?? null /* arrayOf */; set => _parametersBody.DetailContactEmail = value; } + + /// list of action groups to broadcast to + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "list of action groups to broadcast to")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of action groups to broadcast to", + SerializedName = @"contactGroups", + PossibleTypes = new [] { typeof(string) })] + public string[] DetailContactGroup { get => _parametersBody.DetailContactGroup ?? null /* arrayOf */; set => _parametersBody.DetailContactGroup = value; } + + /// list of contact roles + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "list of contact roles")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"list of contact roles", + SerializedName = @"contactRoles", + PossibleTypes = new [] { typeof(string) })] + public string[] DetailContactRole { get => _parametersBody.DetailContactRole ?? null /* arrayOf */; set => _parametersBody.DetailContactRole = value; } + + /// current spend + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "current spend")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"current spend", + SerializedName = @"currentSpend", + PossibleTypes = new [] { typeof(decimal) })] + public decimal DetailCurrentSpend { get => _parametersBody.DetailCurrentSpend ?? default(decimal); set => _parametersBody.DetailCurrentSpend = value; } + + /// department name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "department name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"department name", + SerializedName = @"departmentName", + PossibleTypes = new [] { typeof(string) })] + public string DetailDepartmentName { get => _parametersBody.DetailDepartmentName ?? null; set => _parametersBody.DetailDepartmentName = value; } + + /// datetime of enrollmentEndDate + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "datetime of enrollmentEndDate")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentEndDate", + SerializedName = @"enrollmentEndDate", + PossibleTypes = new [] { typeof(string) })] + public string DetailEnrollmentEndDate { get => _parametersBody.DetailEnrollmentEndDate ?? null; set => _parametersBody.DetailEnrollmentEndDate = value; } + + /// enrollment number + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "enrollment number")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"enrollment number", + SerializedName = @"enrollmentNumber", + PossibleTypes = new [] { typeof(string) })] + public string DetailEnrollmentNumber { get => _parametersBody.DetailEnrollmentNumber ?? null; set => _parametersBody.DetailEnrollmentNumber = value; } + + /// datetime of enrollmentStartDate + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "datetime of enrollmentStartDate")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of enrollmentStartDate", + SerializedName = @"enrollmentStartDate", + PossibleTypes = new [] { typeof(string) })] + public string DetailEnrollmentStartDate { get => _parametersBody.DetailEnrollmentStartDate ?? null; set => _parametersBody.DetailEnrollmentStartDate = value; } + + /// invoicing threshold + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "invoicing threshold")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"invoicing threshold", + SerializedName = @"invoicingThreshold", + PossibleTypes = new [] { typeof(decimal) })] + public decimal DetailInvoicingThreshold { get => _parametersBody.DetailInvoicingThreshold ?? default(decimal); set => _parametersBody.DetailInvoicingThreshold = value; } + + /// array of meters to filter by + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "array of meters to filter by")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of meters to filter by", + SerializedName = @"meterFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailMeterFilter { get => _parametersBody.DetailMeterFilter ?? null /* arrayOf */; set => _parametersBody.DetailMeterFilter = value; } + + /// operator used to compare currentSpend with amount + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "operator used to compare currentSpend with amount")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operator used to compare currentSpend with amount", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator DetailOperator { get => _parametersBody.DetailOperator ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertOperator)""); set => _parametersBody.DetailOperator = value; } + + /// overriding alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "overriding alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"overriding alert", + SerializedName = @"overridingAlert", + PossibleTypes = new [] { typeof(string) })] + public string DetailOverridingAlert { get => _parametersBody.DetailOverridingAlert ?? null; set => _parametersBody.DetailOverridingAlert = value; } + + /// datetime of periodStartDate + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "datetime of periodStartDate")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"datetime of periodStartDate", + SerializedName = @"periodStartDate", + PossibleTypes = new [] { typeof(string) })] + public string DetailPeriodStartDate { get => _parametersBody.DetailPeriodStartDate ?? null; set => _parametersBody.DetailPeriodStartDate = value; } + + /// array of resources to filter by + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "array of resources to filter by")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resources to filter by", + SerializedName = @"resourceFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceFilter { get => _parametersBody.DetailResourceFilter ?? null /* arrayOf */; set => _parametersBody.DetailResourceFilter = value; } + + /// array of resourceGroups to filter by + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "array of resourceGroups to filter by")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"array of resourceGroups to filter by", + SerializedName = @"resourceGroupFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny[] DetailResourceGroupFilter { get => _parametersBody.DetailResourceGroupFilter ?? null /* arrayOf */; set => _parametersBody.DetailResourceGroupFilter = value; } + + /// tags to filter by + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "tags to filter by")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"tags to filter by", + SerializedName = @"tagFilter", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.IAny DetailTagFilter { get => _parametersBody.DetailTagFilter ?? null /* object */; set => _parametersBody.DetailTagFilter = value; } + + /// notification threshold percentage as a decimal which activated this alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "notification threshold percentage as a decimal which activated this alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notification threshold percentage as a decimal which activated this alert", + SerializedName = @"threshold", + PossibleTypes = new [] { typeof(decimal) })] + public decimal DetailThreshold { get => _parametersBody.DetailThreshold ?? default(decimal); set => _parametersBody.DetailThreshold = value; } + + /// Type of timegrain cadence + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of timegrain cadence")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of timegrain cadence", + SerializedName = @"timeGrainType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType DetailTimeGrainType { get => _parametersBody.DetailTimeGrainType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertTimeGrainType)""); set => _parametersBody.DetailTimeGrainType = value; } + + /// notificationId that triggered this alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "notificationId that triggered this alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"notificationId that triggered this alert", + SerializedName = @"triggeredBy", + PossibleTypes = new [] { typeof(string) })] + public string DetailTriggeredBy { get => _parametersBody.DetailTriggeredBy ?? null; set => _parametersBody.DetailTriggeredBy = value; } + + /// unit of currency being used + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "unit of currency being used")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"unit of currency being used", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + public string DetailUnit { get => _parametersBody.DetailUnit ?? null; set => _parametersBody.DetailUnit = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// dateTime in which alert was last modified + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "dateTime in which alert was last modified")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which alert was last modified", + SerializedName = @"modificationTime", + PossibleTypes = new [] { typeof(string) })] + public string ModificationTime { get => _parametersBody.ModificationTime ?? null; set => _parametersBody.ModificationTime = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Source of alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source of alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source of alert", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource Source { get => _parametersBody.Source ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertSource)""); set => _parametersBody.Source = value; } + + /// alert status + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "alert status")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"alert status", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus Status { get => _parametersBody.Status ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AlertStatus)""); set => _parametersBody.Status = value; } + + /// dateTime in which the alert status was last modified + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "dateTime in which the alert status was last modified")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"dateTime in which the alert status was last modified", + SerializedName = @"statusModificationTime", + PossibleTypes = new [] { typeof(string) })] + public string StatusModificationTime { get => _parametersBody.StatusModificationTime ?? null; set => _parametersBody.StatusModificationTime = value; } + + /// User who last modified the alert + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User who last modified the alert")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User who last modified the alert", + SerializedName = @"statusModificationUserName", + PossibleTypes = new [] { typeof(string) })] + public string StatusModificationUserName { get => _parametersBody.StatusModificationUserName ?? null; set => _parametersBody.StatusModificationUserName = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostDismissAlert_DismissViaIdentityExpanded() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AlertsDismiss' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AlertsDismissViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AlertId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AlertId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AlertsDismiss(InputObject.Scope ?? null, InputObject.AlertId ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + 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 }) + { + 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.Cost.Models.Api20211001.IAlert + /// 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.Cost.Models.Api20211001.IAlert + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostExecuteExport_Execute.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostExecuteExport_Execute.cs new file mode 100644 index 000000000000..919bc886428e --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostExecuteExport_Execute.cs @@ -0,0 +1,400 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to execute an export. + /// + /// [OpenAPI] Execute=>POST:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostExecuteExport_Execute", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to execute an export.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostExecuteExport_Execute : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _exportName; + + /// Export Name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Export Name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Export Name.", + SerializedName = @"exportName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string ExportName { get => this._exportName; set => this._exportName = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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. + /// /// 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, 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostExecuteExport_Execute() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportsExecute' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsExecute(Scope, ExportName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostExecuteExport_ExecuteViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostExecuteExport_ExecuteViaIdentity.cs new file mode 100644 index 000000000000..8f83197d1716 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostExecuteExport_ExecuteViaIdentity.cs @@ -0,0 +1,386 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to execute an export. + /// + /// [OpenAPI] Execute=>POST:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostExecuteExport_ExecuteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to execute an export.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostExecuteExport_ExecuteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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. + /// /// 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, 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostExecuteExport_ExecuteViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportsExecute' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ExportsExecuteViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExportName) + { + 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.ExportsExecute(InputObject.Scope ?? null, InputObject.ExportName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_Usage.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_Usage.cs new file mode 100644 index 000000000000..84b045e0e8ad --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_Usage.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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the forecast charges for scope defined. + /// + /// [OpenAPI] Usage=>POST:"/{scope}/providers/Microsoft.CostManagement/forecast" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageForecast_Usage", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the forecast charges for scope defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageForecast_Usage : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition _parameter; + + /// The definition of a forecast. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The definition of a forecast.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The definition of a forecast.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + /// specific for partners. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageForecast_Usage() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ForecastUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ForecastUsage(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Scope, Parameter, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Scope=Scope,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Scope=Scope, body=Parameter }) + { + 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Scope=Scope, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Models.Api20211001.IForecastResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_UsageExpanded.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_UsageExpanded.cs new file mode 100644 index 000000000000..9ca640348cd5 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_UsageExpanded.cs @@ -0,0 +1,610 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the forecast charges for scope defined. + /// + /// [OpenAPI] Usage=>POST:"/{scope}/providers/Microsoft.CostManagement/forecast" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageForecast_UsageExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the forecast charges for scope defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageForecast_UsageExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a forecast. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = 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. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Models.Api20211001.IForecastDatasetAggregation) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation DatasetAggregation { get => _parametersBody.DatasetAggregation ?? null /* object */; set => _parametersBody.DatasetAggregation = value; } + + /// The granularity of rows in the forecast. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the forecast.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the forecast.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType DatasetGranularity { get => _parametersBody.DatasetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); set => _parametersBody.DatasetGranularity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string DimensionName { get => _parametersBody.DimensionName ?? null; set => _parametersBody.DimensionName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] DimensionValue { get => _parametersBody.DimensionValue ?? null /* arrayOf */; set => _parametersBody.DimensionValue = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"AND\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get => _parametersBody.FilterAnd ?? null /* arrayOf */; set => _parametersBody.FilterAnd = value; } + + /// The logical "OR" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"OR\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get => _parametersBody.FilterOr ?? null /* arrayOf */; set => _parametersBody.FilterOr = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// A boolean determining if actualCost will be included. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean determining if actualCost will be included.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if actualCost will be included.", + SerializedName = @"includeActualCost", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IncludeActualCost { get => _parametersBody.IncludeActualCost ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IncludeActualCost = value; } + + /// A boolean determining if FreshPartialCost will be included. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean determining if FreshPartialCost will be included.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if FreshPartialCost will be included.", + SerializedName = @"includeFreshPartialCost", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IncludeFreshPartialCost { get => _parametersBody.IncludeFreshPartialCost ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IncludeFreshPartialCost = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + /// specific for partners. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string TagName { get => _parametersBody.TagName ?? null; set => _parametersBody.TagName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] TagValue { get => _parametersBody.TagValue ?? null /* arrayOf */; set => _parametersBody.TagValue = value; } + + /// The start date to pull data from. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodFrom { get => _parametersBody.TimePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.TimePeriodFrom = value; } + + /// The end date to pull data to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodTo { get => _parametersBody.TimePeriodTo ?? default(global::System.DateTime); set => _parametersBody.TimePeriodTo = value; } + + /// The type of the forecast. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the forecast.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the forecast.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType Type { get => _parametersBody.Type; set => _parametersBody.Type = 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageForecast_UsageExpanded() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ForecastUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ForecastUsage(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Scope, _parametersBody, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Scope=Scope,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Scope=Scope, body=_parametersBody }) + { + 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Scope=Scope, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Models.Api20211001.IForecastResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_UsageViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_UsageViaIdentity.cs new file mode 100644 index 000000000000..c9d644be00e6 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_UsageViaIdentity.cs @@ -0,0 +1,448 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the forecast charges for scope defined. + /// + /// [OpenAPI] Usage=>POST:"/{scope}/providers/Microsoft.CostManagement/forecast" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageForecast_UsageViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the forecast charges for scope defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageForecast_UsageViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition _parameter; + + /// The definition of a forecast. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The definition of a forecast.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The definition of a forecast.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageForecast_UsageViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ForecastUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ForecastUsageViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Parameter, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ForecastUsage(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, InputObject.Scope ?? null, Parameter, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, body=Parameter }) + { + 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Models.Api20211001.IForecastResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_UsageViaIdentityExpanded.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_UsageViaIdentityExpanded.cs new file mode 100644 index 000000000000..8c39ceb2a89b --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageForecast_UsageViaIdentityExpanded.cs @@ -0,0 +1,606 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Lists the forecast charges for scope defined. + /// + /// [OpenAPI] Usage=>POST:"/{scope}/providers/Microsoft.CostManagement/forecast" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageForecast_UsageViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Lists the forecast charges for scope defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageForecast_UsageViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a forecast. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.ForecastDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = 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. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Models.Api20211001.IForecastDatasetAggregation) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastDatasetAggregation DatasetAggregation { get => _parametersBody.DatasetAggregation ?? null /* object */; set => _parametersBody.DatasetAggregation = value; } + + /// The granularity of rows in the forecast. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the forecast.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the forecast.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType DatasetGranularity { get => _parametersBody.DatasetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); set => _parametersBody.DatasetGranularity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string DimensionName { get => _parametersBody.DimensionName ?? null; set => _parametersBody.DimensionName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] DimensionValue { get => _parametersBody.DimensionValue ?? null /* arrayOf */; set => _parametersBody.DimensionValue = value; } + + /// Backing field for property. + private string _filter; + + /// + /// May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter + /// supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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'.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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'.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"AND\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterAnd { get => _parametersBody.FilterAnd ?? null /* arrayOf */; set => _parametersBody.FilterAnd = value; } + + /// The logical "OR" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"OR\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IForecastFilter[] FilterOr { get => _parametersBody.FilterOr ?? null /* arrayOf */; set => _parametersBody.FilterOr = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// A boolean determining if actualCost will be included. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean determining if actualCost will be included.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if actualCost will be included.", + SerializedName = @"includeActualCost", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IncludeActualCost { get => _parametersBody.IncludeActualCost ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IncludeActualCost = value; } + + /// A boolean determining if FreshPartialCost will be included. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean determining if FreshPartialCost will be included.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean determining if FreshPartialCost will be included.", + SerializedName = @"includeFreshPartialCost", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IncludeFreshPartialCost { get => _parametersBody.IncludeFreshPartialCost ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IncludeFreshPartialCost = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string TagName { get => _parametersBody.TagName ?? null; set => _parametersBody.TagName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] TagValue { get => _parametersBody.TagValue ?? null /* arrayOf */; set => _parametersBody.TagValue = value; } + + /// The start date to pull data from. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodFrom { get => _parametersBody.TimePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.TimePeriodFrom = value; } + + /// The end date to pull data to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodTo { get => _parametersBody.TimePeriodTo ?? default(global::System.DateTime); set => _parametersBody.TimePeriodTo = value; } + + /// The type of the forecast. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the forecast.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the forecast.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ForecastType Type { get => _parametersBody.Type; set => _parametersBody.Type = 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageForecast_UsageViaIdentityExpanded() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ForecastUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ForecastUsageViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, _parametersBody, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ForecastUsage(this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, InputObject.Scope ?? null, _parametersBody, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, body=_parametersBody }) + { + 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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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.Cost.Models.Api20211001.IForecastResult + /// 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.Cost.Models.Api20211001.IForecastResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_Usage.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_Usage.cs new file mode 100644 index 000000000000..0cd4a3f2681e --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_Usage.cs @@ -0,0 +1,435 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Query the usage data for scope defined. + /// + /// [OpenAPI] Usage=>POST:"/{scope}/providers/Microsoft.CostManagement/query" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageQuery_Usage", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Query the usage data for scope defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageQuery_Usage : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition _parameter; + + /// The definition of a query. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The definition of a query.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The definition of a query.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription + /// scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + /// specific for partners. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageQuery_Usage() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueryUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueryUsage(Scope, Parameter, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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=Parameter }) + { + 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=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Models.Api20211001.IQueryResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_Usage1.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_Usage1.cs new file mode 100644 index 000000000000..b67c70b7c6bc --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_Usage1.cs @@ -0,0 +1,405 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Query the usage data for external cloud provider type defined. + /// + /// [OpenAPI] UsageByExternalCloudProviderType=>POST:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageQuery_Usage1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Query the usage data for external cloud provider type defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageQuery_Usage1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _externalCloudProviderId; + + /// + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used + /// with dimension/query operations. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", + SerializedName = @"externalCloudProviderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string ExternalCloudProviderId { get => this._externalCloudProviderId; set => this._externalCloudProviderId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType _externalCloudProviderType; + + /// + /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for + /// linked account and 'externalBillingAccounts' for consolidated account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.ExternalCloudProviderType) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType ExternalCloudProviderType { get => this._externalCloudProviderType; set => this._externalCloudProviderType = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition _parameter; + + /// The definition of a query. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The definition of a query.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The definition of a query.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageQuery_Usage1() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueryUsageByExternalCloudProviderType' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueryUsageByExternalCloudProviderType(ExternalCloudProviderType, ExternalCloudProviderId, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ExternalCloudProviderType=ExternalCloudProviderType,ExternalCloudProviderId=ExternalCloudProviderId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, body=Parameter }) + { + 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 { ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, body=Parameter }) + { + 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Models.Api20211001.IQueryResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageExpanded.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageExpanded.cs new file mode 100644 index 000000000000..2cafba2d20a3 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageExpanded.cs @@ -0,0 +1,599 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Query the usage data for scope defined. + /// + /// [OpenAPI] Usage=>POST:"/{scope}/providers/Microsoft.CostManagement/query" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageQuery_UsageExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Query the usage data for scope defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageQuery_UsageExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a query. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = 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. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryDatasetAggregation) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation DatasetAggregation { get => _parametersBody.DatasetAggregation ?? null /* object */; set => _parametersBody.DatasetAggregation = value; } + + /// The granularity of rows in the query. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the query.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType DatasetGranularity { get => _parametersBody.DatasetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); set => _parametersBody.DatasetGranularity = value; } + + /// + /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of group by expression to use in the query. Query can have up to 2 group by clauses.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryGrouping) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] DatasetGrouping { get => _parametersBody.DatasetGrouping ?? null /* arrayOf */; set => _parametersBody.DatasetGrouping = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string DimensionName { get => _parametersBody.DimensionName ?? null; set => _parametersBody.DimensionName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] DimensionValue { get => _parametersBody.DimensionValue ?? null /* arrayOf */; set => _parametersBody.DimensionValue = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"AND\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get => _parametersBody.FilterAnd ?? null /* arrayOf */; set => _parametersBody.FilterAnd = value; } + + /// The logical "OR" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"OR\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get => _parametersBody.FilterOr ?? null /* arrayOf */; set => _parametersBody.FilterOr = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription + /// scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' + /// for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' + /// for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + /// for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile + /// scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + /// for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' + /// specific for partners. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string TagName { get => _parametersBody.TagName ?? null; set => _parametersBody.TagName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] TagValue { get => _parametersBody.TagValue ?? null /* arrayOf */; set => _parametersBody.TagValue = value; } + + /// The start date to pull data from. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodFrom { get => _parametersBody.TimePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.TimePeriodFrom = value; } + + /// The end date to pull data to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodTo { get => _parametersBody.TimePeriodTo ?? default(global::System.DateTime); set => _parametersBody.TimePeriodTo = value; } + + /// + /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The time frame for pulling data for the query. If custom, then a specific time period must be provided.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.TimeframeType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType Timeframe { get => _parametersBody.Timeframe; set => _parametersBody.Timeframe = value; } + + /// The type of the query. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the query.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType Type { get => _parametersBody.Type; set => _parametersBody.Type = 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageQuery_UsageExpanded() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueryUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueryUsage(Scope, _parametersBody, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Models.Api20211001.IQueryResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageExpanded1.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageExpanded1.cs new file mode 100644 index 000000000000..bcdbba119790 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageExpanded1.cs @@ -0,0 +1,569 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Query the usage data for external cloud provider type defined. + /// + /// [OpenAPI] UsageByExternalCloudProviderType=>POST:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageQuery_UsageExpanded1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Query the usage data for external cloud provider type defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageQuery_UsageExpanded1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a query. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = 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. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryDatasetAggregation) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation DatasetAggregation { get => _parametersBody.DatasetAggregation ?? null /* object */; set => _parametersBody.DatasetAggregation = value; } + + /// The granularity of rows in the query. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the query.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType DatasetGranularity { get => _parametersBody.DatasetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); set => _parametersBody.DatasetGranularity = value; } + + /// + /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of group by expression to use in the query. Query can have up to 2 group by clauses.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryGrouping) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] DatasetGrouping { get => _parametersBody.DatasetGrouping ?? null /* arrayOf */; set => _parametersBody.DatasetGrouping = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string DimensionName { get => _parametersBody.DimensionName ?? null; set => _parametersBody.DimensionName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] DimensionValue { get => _parametersBody.DimensionValue ?? null /* arrayOf */; set => _parametersBody.DimensionValue = value; } + + /// Backing field for property. + private string _externalCloudProviderId; + + /// + /// This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used + /// with dimension/query operations. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", + SerializedName = @"externalCloudProviderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string ExternalCloudProviderId { get => this._externalCloudProviderId; set => this._externalCloudProviderId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType _externalCloudProviderType; + + /// + /// The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for + /// linked account and 'externalBillingAccounts' for consolidated account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.ExternalCloudProviderType) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType ExternalCloudProviderType { get => this._externalCloudProviderType; set => this._externalCloudProviderType = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"AND\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get => _parametersBody.FilterAnd ?? null /* arrayOf */; set => _parametersBody.FilterAnd = value; } + + /// The logical "OR" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"OR\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get => _parametersBody.FilterOr ?? null /* arrayOf */; set => _parametersBody.FilterOr = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string TagName { get => _parametersBody.TagName ?? null; set => _parametersBody.TagName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] TagValue { get => _parametersBody.TagValue ?? null /* arrayOf */; set => _parametersBody.TagValue = value; } + + /// The start date to pull data from. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodFrom { get => _parametersBody.TimePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.TimePeriodFrom = value; } + + /// The end date to pull data to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodTo { get => _parametersBody.TimePeriodTo ?? default(global::System.DateTime); set => _parametersBody.TimePeriodTo = value; } + + /// + /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The time frame for pulling data for the query. If custom, then a specific time period must be provided.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.TimeframeType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType Timeframe { get => _parametersBody.Timeframe; set => _parametersBody.Timeframe = value; } + + /// The type of the query. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the query.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType Type { get => _parametersBody.Type; set => _parametersBody.Type = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageQuery_UsageExpanded1() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueryUsageByExternalCloudProviderType' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueryUsageByExternalCloudProviderType(ExternalCloudProviderType, ExternalCloudProviderId, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ExternalCloudProviderType=ExternalCloudProviderType,ExternalCloudProviderId=ExternalCloudProviderId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, body=_parametersBody }) + { + 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 { ExternalCloudProviderType=ExternalCloudProviderType, ExternalCloudProviderId=ExternalCloudProviderId, body=_parametersBody }) + { + 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Models.Api20211001.IQueryResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentity.cs new file mode 100644 index 000000000000..d36296b86900 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentity.cs @@ -0,0 +1,431 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Query the usage data for scope defined. + /// + /// [OpenAPI] Usage=>POST:"/{scope}/providers/Microsoft.CostManagement/query" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageQuery_UsageViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Query the usage data for scope defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageQuery_UsageViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition _parameter; + + /// The definition of a query. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The definition of a query.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The definition of a query.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageQuery_UsageViaIdentity() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueryUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.QueryUsageViaIdentity(InputObject.Id, Parameter, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.QueryUsage(InputObject.Scope ?? null, Parameter, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + 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=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Models.Api20211001.IQueryResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentity1.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentity1.cs new file mode 100644 index 000000000000..1a5413ab7f50 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentity1.cs @@ -0,0 +1,394 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Query the usage data for external cloud provider type defined. + /// + /// [OpenAPI] UsageByExternalCloudProviderType=>POST:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageQuery_UsageViaIdentity1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Query the usage data for external cloud provider type defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageQuery_UsageViaIdentity1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition _parameter; + + /// The definition of a query. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The definition of a query.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The definition of a query.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageQuery_UsageViaIdentity1() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueryUsageByExternalCloudProviderType' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.QueryUsageByExternalCloudProviderTypeViaIdentity(InputObject.Id, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ExternalCloudProviderType) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderType"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExternalCloudProviderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.QueryUsageByExternalCloudProviderType(InputObject.ExternalCloudProviderType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType)""), InputObject.ExternalCloudProviderId ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + 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=Parameter }) + { + 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Models.Api20211001.IQueryResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentityExpanded.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentityExpanded.cs new file mode 100644 index 000000000000..b99b22a4a297 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentityExpanded.cs @@ -0,0 +1,595 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Query the usage data for scope defined. + /// + /// [OpenAPI] Usage=>POST:"/{scope}/providers/Microsoft.CostManagement/query" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageQuery_UsageViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Query the usage data for scope defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageQuery_UsageViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a query. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = 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. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryDatasetAggregation) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation DatasetAggregation { get => _parametersBody.DatasetAggregation ?? null /* object */; set => _parametersBody.DatasetAggregation = value; } + + /// The granularity of rows in the query. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the query.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType DatasetGranularity { get => _parametersBody.DatasetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); set => _parametersBody.DatasetGranularity = value; } + + /// + /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of group by expression to use in the query. Query can have up to 2 group by clauses.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryGrouping) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] DatasetGrouping { get => _parametersBody.DatasetGrouping ?? null /* arrayOf */; set => _parametersBody.DatasetGrouping = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string DimensionName { get => _parametersBody.DimensionName ?? null; set => _parametersBody.DimensionName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] DimensionValue { get => _parametersBody.DimensionValue ?? null /* arrayOf */; set => _parametersBody.DimensionValue = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"AND\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get => _parametersBody.FilterAnd ?? null /* arrayOf */; set => _parametersBody.FilterAnd = value; } + + /// The logical "OR" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"OR\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get => _parametersBody.FilterOr ?? null /* arrayOf */; set => _parametersBody.FilterOr = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string TagName { get => _parametersBody.TagName ?? null; set => _parametersBody.TagName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] TagValue { get => _parametersBody.TagValue ?? null /* arrayOf */; set => _parametersBody.TagValue = value; } + + /// The start date to pull data from. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodFrom { get => _parametersBody.TimePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.TimePeriodFrom = value; } + + /// The end date to pull data to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodTo { get => _parametersBody.TimePeriodTo ?? default(global::System.DateTime); set => _parametersBody.TimePeriodTo = value; } + + /// + /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The time frame for pulling data for the query. If custom, then a specific time period must be provided.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.TimeframeType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType Timeframe { get => _parametersBody.Timeframe; set => _parametersBody.Timeframe = value; } + + /// The type of the query. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the query.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType Type { get => _parametersBody.Type; set => _parametersBody.Type = 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageQuery_UsageViaIdentityExpanded() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueryUsage' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.QueryUsageViaIdentity(InputObject.Id, _parametersBody, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.QueryUsage(InputObject.Scope ?? null, _parametersBody, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + 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 }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Models.Api20211001.IQueryResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentityExpanded1.cs b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentityExpanded1.cs new file mode 100644 index 000000000000..7afbd0d03d4c --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/InvokeAzCostUsageQuery_UsageViaIdentityExpanded1.cs @@ -0,0 +1,558 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// Query the usage data for external cloud provider type defined. + /// + /// [OpenAPI] UsageByExternalCloudProviderType=>POST:"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzCostUsageQuery_UsageViaIdentityExpanded1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Query the usage data for external cloud provider type defined.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class InvokeAzCostUsageQuery_UsageViaIdentityExpanded1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a query. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// 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. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string[] ConfigurationColumn { get => _parametersBody.ConfigurationColumn ?? null /* arrayOf */; set => _parametersBody.ConfigurationColumn = 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. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryDatasetAggregation) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryDatasetAggregation DatasetAggregation { get => _parametersBody.DatasetAggregation ?? null /* object */; set => _parametersBody.DatasetAggregation = value; } + + /// The granularity of rows in the query. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The granularity of rows in the query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the query.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType DatasetGranularity { get => _parametersBody.DatasetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); set => _parametersBody.DatasetGranularity = value; } + + /// + /// Array of group by expression to use in the query. Query can have up to 2 group by clauses. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of group by expression to use in the query. Query can have up to 2 group by clauses.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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.Cost.Models.Api20211001.IQueryGrouping) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryGrouping[] DatasetGrouping { get => _parametersBody.DatasetGrouping ?? null /* arrayOf */; set => _parametersBody.DatasetGrouping = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string DimensionName { get => _parametersBody.DimensionName ?? null; set => _parametersBody.DimensionName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] DimensionValue { get => _parametersBody.DimensionValue ?? null /* arrayOf */; set => _parametersBody.DimensionValue = value; } + + /// The logical "AND" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"AND\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""AND"" expression. Must have at least 2 items.", + SerializedName = @"and", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterAnd { get => _parametersBody.FilterAnd ?? null /* arrayOf */; set => _parametersBody.FilterAnd = value; } + + /// The logical "OR" expression. Must have at least 2 items. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The logical \"OR\" expression. Must have at least 2 items.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The logical ""OR"" expression. Must have at least 2 items.", + SerializedName = @"or", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IQueryFilter[] FilterOr { get => _parametersBody.FilterOr ?? null /* arrayOf */; set => _parametersBody.FilterOr = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The name of the column to use in comparison. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the column to use in comparison.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the column to use in comparison.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string TagName { get => _parametersBody.TagName ?? null; set => _parametersBody.TagName = value; } + + /// Array of values to use for comparison + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of values to use for comparison")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of values to use for comparison", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + public string[] TagValue { get => _parametersBody.TagValue ?? null /* arrayOf */; set => _parametersBody.TagValue = value; } + + /// The start date to pull data from. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodFrom { get => _parametersBody.TimePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.TimePeriodFrom = value; } + + /// The end date to pull data to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodTo { get => _parametersBody.TimePeriodTo ?? default(global::System.DateTime); set => _parametersBody.TimePeriodTo = value; } + + /// + /// The time frame for pulling data for the query. If custom, then a specific time period must be provided. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The time frame for pulling data for the query. If custom, then a specific time period must be provided.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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.Cost.Support.TimeframeType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType Timeframe { get => _parametersBody.Timeframe; set => _parametersBody.Timeframe = value; } + + /// The type of the query. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The type of the query.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The type of the query.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType Type { get => _parametersBody.Type; set => _parametersBody.Type = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzCostUsageQuery_UsageViaIdentityExpanded1() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueryUsageByExternalCloudProviderType' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.QueryUsageByExternalCloudProviderTypeViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ExternalCloudProviderType) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderType"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExternalCloudProviderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ExternalCloudProviderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.QueryUsageByExternalCloudProviderType(InputObject.ExternalCloudProviderType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType)""), InputObject.ExternalCloudProviderId ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + 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 }) + { + 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.Cost.Models.Api20211001.IQueryResult + /// 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.Cost.Models.Api20211001.IQueryResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/NewAzCostExport_CreateExpanded.cs b/swaggerci/cost-management/generated/cmdlets/NewAzCostExport_CreateExpanded.cs new file mode 100644 index 000000000000..ccfdf6af7f68 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/NewAzCostExport_CreateExpanded.cs @@ -0,0 +1,672 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + 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. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostExport_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class NewAzCostExport_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// An export resource. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IExport _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.Export(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// 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). + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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; } + + /// 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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The granularity of rows in the export. Currently only 'Daily' is supported.", + SerializedName = @"granularity", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType DataSetGranularity { get => _parametersBody.DataSetGranularity ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType)""); set => _parametersBody.DataSetGranularity = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The time frame for pulling data for the export. If custom, then a specific time period must be provided. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time frame for pulling data for the export. If custom, then a specific time period must be provided.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + 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.Cost.Support.TimeframeType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType DefinitionTimeframe { get => _parametersBody.DefinitionTimeframe ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType)""); 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 + /// data for charges or amortization for service reservations. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + 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.Cost.Support.ExportType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType DefinitionType { get => _parametersBody.DefinitionType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType)""); set => _parametersBody.DefinitionType = value; } + + /// + /// The name of the container where exports will be uploaded. If the container does not exist it will be created. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the container where exports will be uploaded. If the container does not exist it will be created.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string DestinationContainer { get => _parametersBody.DestinationContainer ?? null; set => _parametersBody.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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount are specified.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string DestinationResourceId { get => _parametersBody.DestinationResourceId ?? null; set => _parametersBody.DestinationResourceId = value; } + + /// The name of the directory where exports will be uploaded. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the directory where exports will be uploaded.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the directory where exports will be uploaded.", + SerializedName = @"rootFolderPath", + PossibleTypes = new [] { typeof(string) })] + public string DestinationRootFolderPath { get => _parametersBody.DestinationRootFolderPath ?? null; set => _parametersBody.DestinationRootFolderPath = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string DestinationSasToken { get => _parametersBody.DestinationSasToken ?? null; set => _parametersBody.DestinationSasToken = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string DestinationStorageAccount { get => _parametersBody.DestinationStorageAccount ?? null; set => _parametersBody.DestinationStorageAccount = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The format of the export being delivered. Currently only 'Csv' is supported.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType Format { get => _parametersBody.Format ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType)""); 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter PartitionData { get => _parametersBody.PartitionData ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.PartitionData = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The start date of recurrence. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date of recurrence.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date of recurrence.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime RecurrencePeriodFrom { get => _parametersBody.RecurrencePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.RecurrencePeriodFrom = value; } + + /// The end date of recurrence. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date of recurrence.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date of recurrence.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime RecurrencePeriodTo { get => _parametersBody.RecurrencePeriodTo ?? default(global::System.DateTime); set => _parametersBody.RecurrencePeriodTo = value; } + + /// The schedule recurrence. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The schedule recurrence.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The schedule recurrence.", + SerializedName = @"recurrence", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType ScheduleRecurrence { get => _parametersBody.ScheduleRecurrence ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType)""); set => _parametersBody.ScheduleRecurrence = value; } + + /// + /// The status of the export's schedule. If 'Inactive', the export's schedule is paused. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The status of the export's schedule. If 'Inactive', the export's schedule is paused.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Support.StatusType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType ScheduleStatus { get => _parametersBody.ScheduleStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType)""); set => _parametersBody.ScheduleStatus = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// The start date for export data. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date for export data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date for export data.", + SerializedName = @"from", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodFrom { get => _parametersBody.TimePeriodFrom ?? default(global::System.DateTime); set => _parametersBody.TimePeriodFrom = value; } + + /// The end date for export data. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date for export data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date for export data.", + SerializedName = @"to", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimePeriodTo { get => _parametersBody.TimePeriodTo ?? default(global::System.DateTime); set => _parametersBody.TimePeriodTo = 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzCostExport_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsCreateOrUpdate(Scope, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IExport + WriteObject((await response)); + } + } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IExport + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/NewAzCostGenerateCostDetailReportOperation_CreateExpanded.cs b/swaggerci/cost-management/generated/cmdlets/NewAzCostGenerateCostDetailReportOperation_CreateExpanded.cs new file mode 100644 index 000000000000..1c3a16573aaf --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/NewAzCostGenerateCostDetailReportOperation_CreateExpanded.cs @@ -0,0 +1,524 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + 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, @"AzCostGenerateCostDetailReportOperation_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.ICostDetailsOperationResults))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Generated] + public partial class NewAzCostGenerateCostDetailReportOperation_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a cost detailed report. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.IGenerateCostDetailsReportRequestDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20220501.GenerateCostDetailsReportRequestDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { 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 + /// is not provided in the request body the API will return the current month's cost. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string BillingPeriod { get => _parametersBody.BillingPeriod ?? null; set => _parametersBody.BillingPeriod = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string InvoiceId { get => _parametersBody.InvoiceId ?? null; set => _parametersBody.InvoiceId = value; } + + /// The type of the detailed report. By default ActualCost is provided + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the detailed report. By default ActualCost is provided")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the detailed report. By default ActualCost is provided", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType Metric { get => _parametersBody.Metric ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.CostDetailsMetricType)""); set => _parametersBody.Metric = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// The end date to pull data to. example format 2020-03-15 + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to. example format 2020-03-15")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to. example format 2020-03-15", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + public string TimePeriodEnd { get => _parametersBody.TimePeriodEnd ?? null; set => _parametersBody.TimePeriodEnd = value; } + + /// The start date to pull data from. example format 2020-03-15 + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from. example format 2020-03-15")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from. example format 2020-03-15", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + public string TimePeriodStart { get => _parametersBody.TimePeriodStart ?? null; set => _parametersBody.TimePeriodStart = 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.Cost.Models.Api20220501.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.Cost.Models.Api20220501.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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzCostGenerateCostDetailReportOperation_CreateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Cmdlets.NewAzCostGenerateCostDetailReportOperation_CreateExpanded Clone() + { + var clone = new NewAzCostGenerateCostDetailReportOperation_CreateExpanded(); + 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._parametersBody = this._parametersBody; + clone.Scope = this.Scope; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.Cost.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzCostGenerateCostDetailReportOperation_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GenerateCostDetailsReportCreateOperation(Scope, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20220501.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20220501.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.Cost.Models.Api20220501.ICostDetailsOperationResults + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/NewAzCostGenerateDetailedCostReportOperation_CreateExpanded.cs b/swaggerci/cost-management/generated/cmdlets/NewAzCostGenerateDetailedCostReportOperation_CreateExpanded.cs new file mode 100644 index 000000000000..f3b510e8b7f7 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/NewAzCostGenerateDetailedCostReportOperation_CreateExpanded.cs @@ -0,0 +1,530 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously + /// at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation + /// created. A call on the operation will provide the status and if the operation is completed the blob file where generated + /// detailed cost report is being stored. + /// + /// + /// [OpenAPI] CreateOperation=>POST:"/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostGenerateDetailedCostReportOperation_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class NewAzCostGenerateDetailedCostReportOperation_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// The definition of a cost detailed report. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IGenerateDetailedCostReportDefinition _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.GenerateDetailedCostReportDefinition(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one + /// of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided.", + SerializedName = @"billingPeriod", + PossibleTypes = new [] { typeof(string) })] + public string BillingPeriod { get => _parametersBody.BillingPeriod ?? null; set => _parametersBody.BillingPeriod = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// Customer Id for Modern (Invoice Id and billing profile is also required for this). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Customer Id for Modern (Invoice Id and billing profile is also required for this).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Customer Id for Modern (Invoice Id and billing profile is also required for this).", + SerializedName = @"customerId", + PossibleTypes = new [] { typeof(string) })] + public string CustomerId { get => _parametersBody.CustomerId ?? null; set => _parametersBody.CustomerId = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId + /// or billingPeriod parameters. If none provided current month cost is provided. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided.", + SerializedName = @"invoiceId", + PossibleTypes = new [] { typeof(string) })] + public string InvoiceId { get => _parametersBody.InvoiceId ?? null; set => _parametersBody.InvoiceId = value; } + + /// The type of the detailed report. By default ActualCost is provided + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the detailed report. By default ActualCost is provided")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the detailed report. By default ActualCost is provided", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType Metric { get => _parametersBody.Metric ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GenerateDetailedCostReportMetricType)""); set => _parametersBody.Metric = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// The end date to pull data to. example format 2020-03-15 + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end date to pull data to. example format 2020-03-15")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end date to pull data to. example format 2020-03-15", + SerializedName = @"end", + PossibleTypes = new [] { typeof(string) })] + public string TimePeriodEnd { get => _parametersBody.TimePeriodEnd ?? null; set => _parametersBody.TimePeriodEnd = value; } + + /// The start date to pull data from. example format 2020-03-15 + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start date to pull data from. example format 2020-03-15")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start date to pull data from. example format 2020-03-15", + SerializedName = @"start", + PossibleTypes = new [] { typeof(string) })] + public string TimePeriodStart { get => _parametersBody.TimePeriodStart ?? null; set => _parametersBody.TimePeriodStart = 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.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzCostGenerateDetailedCostReportOperation_CreateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Cmdlets.NewAzCostGenerateDetailedCostReportOperation_CreateExpanded Clone() + { + var clone = new NewAzCostGenerateDetailedCostReportOperation_CreateExpanded(); + 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._parametersBody = this._parametersBody; + clone.Scope = this.Scope; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.Cost.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzCostGenerateDetailedCostReportOperation_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GenerateDetailedCostReportCreateOperation' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GenerateDetailedCostReportCreateOperation(Scope, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.IGenerateDetailedCostReportErrorResponse + /// 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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + /// 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.Cost.Models.Api20211001.IGenerateDetailedCostReportOperationResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/NewAzCostView_Create1.cs b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_Create1.cs new file mode 100644 index 000000000000..2ad3d24743f8 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_Create1.cs @@ -0,0 +1,448 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CreateOrUpdateByScope=>PUT:"/{scope}/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostView_Create1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class NewAzCostView_Create1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// View name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "View name")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"View name", + SerializedName = @"viewName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ViewName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView _parameter; + + /// States and configurations of Cost Analysis. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "States and configurations of Cost Analysis.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"States and configurations of Cost Analysis.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IView + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzCostView_Create1() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ViewsCreateOrUpdateByScope' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsCreateOrUpdateByScope(Scope, Name, Parameter, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.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=Parameter }) + { + 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=Parameter }) + { + 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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateExpanded.cs b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateExpanded.cs new file mode 100644 index 000000000000..fa4304568312 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateExpanded.cs @@ -0,0 +1,531 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostView_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class NewAzCostView_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// States and configurations of Cost Analysis. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View(); + + /// Show costs accumulated over time. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Show costs accumulated over time.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Show costs accumulated over time.", + SerializedName = @"accumulated", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType Accumulated { get => _parametersBody.Accumulated ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType)""); set => _parametersBody.Accumulated = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Chart type of the main view in Cost Analysis. Required. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Chart type of the main view in Cost Analysis. Required.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Chart type of the main view in Cost Analysis. Required.", + SerializedName = @"chart", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType Chart { get => _parametersBody.Chart ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType)""); set => _parametersBody.Chart = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// User input name of the view. Required. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User input name of the view. Required.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User input name of the view. Required.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _parametersBody.DisplayName ?? null; set => _parametersBody.DisplayName = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// List of KPIs to show in Cost Analysis UI. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of KPIs to show in Cost Analysis UI.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of KPIs to show in Cost Analysis UI.", + SerializedName = @"kpis", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[] Kpi { get => _parametersBody.Kpi ?? null /* arrayOf */; set => _parametersBody.Kpi = value; } + + /// Metric to use when displaying costs. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Metric to use when displaying costs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric to use when displaying costs.", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType Metric { get => _parametersBody.Metric ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType)""); set => _parametersBody.Metric = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// View name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "View name")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"View name", + SerializedName = @"viewName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ViewName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline Pipeline { get; set; } + + /// Configuration of 3 sub-views in the Cost Analysis UI. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Configuration of 3 sub-views in the Cost Analysis UI.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Configuration of 3 sub-views in the Cost Analysis UI.", + SerializedName = @"pivots", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[] Pivot { get => _parametersBody.Pivot ?? null /* arrayOf */; set => _parametersBody.Pivot = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Query body configuration. Required. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Query body configuration. Required.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query body configuration. Required.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition Query { get => _parametersBody.Query ?? null /* object */; set => _parametersBody.Query = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string Scope { get => _parametersBody.Scope ?? null; set => _parametersBody.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IView + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzCostView_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ViewsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsCreateOrUpdate(Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, body=_parametersBody }) + { + 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 { Name=Name, body=_parametersBody }) + { + 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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateExpanded1.cs b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateExpanded1.cs new file mode 100644 index 000000000000..d5d7ec8f4594 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateExpanded1.cs @@ -0,0 +1,555 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CreateOrUpdateByScope=>PUT:"/{scope}/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostView_CreateExpanded1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class NewAzCostView_CreateExpanded1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// States and configurations of Cost Analysis. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View(); + + /// Show costs accumulated over time. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Show costs accumulated over time.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Show costs accumulated over time.", + SerializedName = @"accumulated", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType Accumulated { get => _parametersBody.Accumulated ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType)""); set => _parametersBody.Accumulated = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Chart type of the main view in Cost Analysis. Required. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Chart type of the main view in Cost Analysis. Required.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Chart type of the main view in Cost Analysis. Required.", + SerializedName = @"chart", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType Chart { get => _parametersBody.Chart ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType)""); set => _parametersBody.Chart = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// User input name of the view. Required. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User input name of the view. Required.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User input name of the view. Required.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _parametersBody.DisplayName ?? null; set => _parametersBody.DisplayName = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// List of KPIs to show in Cost Analysis UI. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of KPIs to show in Cost Analysis UI.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of KPIs to show in Cost Analysis UI.", + SerializedName = @"kpis", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[] Kpi { get => _parametersBody.Kpi ?? null /* arrayOf */; set => _parametersBody.Kpi = value; } + + /// Metric to use when displaying costs. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Metric to use when displaying costs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric to use when displaying costs.", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType Metric { get => _parametersBody.Metric ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType)""); set => _parametersBody.Metric = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// View name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "View name")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"View name", + SerializedName = @"viewName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ViewName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline Pipeline { get; set; } + + /// Configuration of 3 sub-views in the Cost Analysis UI. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Configuration of 3 sub-views in the Cost Analysis UI.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Configuration of 3 sub-views in the Cost Analysis UI.", + SerializedName = @"pivots", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[] Pivot { get => _parametersBody.Pivot ?? null /* arrayOf */; set => _parametersBody.Pivot = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string PropertiesScope { get => _parametersBody.Scope ?? null; set => _parametersBody.Scope = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Query body configuration. Required. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Query body configuration. Required.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query body configuration. Required.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition Query { get => _parametersBody.Query ?? null /* object */; set => _parametersBody.Query = value; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IView + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzCostView_CreateExpanded1() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ViewsCreateOrUpdateByScope' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsCreateOrUpdateByScope(Scope, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateViaIdentity1.cs b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateViaIdentity1.cs new file mode 100644 index 000000000000..fa38b9526c4c --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateViaIdentity1.cs @@ -0,0 +1,433 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CreateOrUpdateByScope=>PUT:"/{scope}/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostView_CreateViaIdentity1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class NewAzCostView_CreateViaIdentity1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView _parameter; + + /// States and configurations of Cost Analysis. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "States and configurations of Cost Analysis.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"States and configurations of Cost Analysis.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IView + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzCostView_CreateViaIdentity1() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ViewsCreateOrUpdateByScope' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ViewsCreateOrUpdateByScopeViaIdentity(InputObject.Id, Parameter, onOk, onCreated, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ViewName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ViewName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ViewsCreateOrUpdateByScope(InputObject.Scope ?? null, InputObject.ViewName ?? null, Parameter, onOk, onCreated, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + 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=Parameter }) + { + 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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateViaIdentityExpanded1.cs b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateViaIdentityExpanded1.cs new file mode 100644 index 000000000000..5070f79481e6 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/NewAzCostView_CreateViaIdentityExpanded1.cs @@ -0,0 +1,540 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// + /// 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. + /// + /// + /// [OpenAPI] CreateOrUpdateByScope=>PUT:"/{scope}/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzCostView_CreateViaIdentityExpanded1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class NewAzCostView_CreateViaIdentityExpanded1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// States and configurations of Cost Analysis. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IView _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.View(); + + /// Show costs accumulated over time. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Show costs accumulated over time.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Show costs accumulated over time.", + SerializedName = @"accumulated", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType Accumulated { get => _parametersBody.Accumulated ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.AccumulatedType)""); set => _parametersBody.Accumulated = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Chart type of the main view in Cost Analysis. Required. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Chart type of the main view in Cost Analysis. Required.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Chart type of the main view in Cost Analysis. Required.", + SerializedName = @"chart", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType Chart { get => _parametersBody.Chart ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ChartType)""); set => _parametersBody.Chart = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// User input name of the view. Required. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User input name of the view. Required.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User input name of the view. Required.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _parametersBody.DisplayName ?? null; set => _parametersBody.DisplayName = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string ETag { get => _parametersBody.ETag ?? null; set => _parametersBody.ETag = 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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// List of KPIs to show in Cost Analysis UI. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of KPIs to show in Cost Analysis UI.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of KPIs to show in Cost Analysis UI.", + SerializedName = @"kpis", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IKpiProperties[] Kpi { get => _parametersBody.Kpi ?? null /* arrayOf */; set => _parametersBody.Kpi = value; } + + /// Metric to use when displaying costs. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Metric to use when displaying costs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric to use when displaying costs.", + SerializedName = @"metric", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType))] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType Metric { get => _parametersBody.Metric ?? ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.MetricType)""); set => _parametersBody.Metric = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.HttpPipeline Pipeline { get; set; } + + /// Configuration of 3 sub-views in the Cost Analysis UI. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Configuration of 3 sub-views in the Cost Analysis UI.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Configuration of 3 sub-views in the Cost Analysis UI.", + SerializedName = @"pivots", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IPivotProperties[] Pivot { get => _parametersBody.Pivot ?? null /* arrayOf */; set => _parametersBody.Pivot = value; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Query body configuration. Required. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Query body configuration. Required.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Query body configuration. Required.", + SerializedName = @"query", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IReportConfigDefinition Query { get => _parametersBody.Query ?? null /* object */; set => _parametersBody.Query = value; } + + /// + /// 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. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + public string Scope { get => _parametersBody.Scope ?? null; set => _parametersBody.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.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.Cost.Models.Api20211001.IView + /// 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzCostView_CreateViaIdentityExpanded1() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ViewsCreateOrUpdateByScope' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ViewsCreateOrUpdateByScopeViaIdentity(InputObject.Id, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ViewName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ViewName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ViewsCreateOrUpdateByScope(InputObject.Scope ?? null, InputObject.ViewName ?? null, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + + /// + /// 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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + 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 }) + { + 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.Cost.Models.Api20211001.IView + /// 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.Cost.Models.Api20211001.IView + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/RemoveAzCostExport_Delete.cs b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostExport_Delete.cs new file mode 100644 index 000000000000..a12865321cde --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostExport_Delete.cs @@ -0,0 +1,401 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to delete a export. + /// + /// [OpenAPI] Delete=>DELETE:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzCostExport_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to delete a export.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class RemoveAzCostExport_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"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.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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. + /// /// 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, 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ExportsDelete(Scope, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzCostExport_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + 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. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/RemoveAzCostExport_DeleteViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostExport_DeleteViaIdentity.cs new file mode 100644 index 000000000000..33a103045103 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostExport_DeleteViaIdentity.cs @@ -0,0 +1,386 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to delete a export. + /// + /// [OpenAPI] Delete=>DELETE:"/{scope}/providers/Microsoft.CostManagement/exports/{exportName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzCostExport_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to delete a export.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class RemoveAzCostExport_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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. + /// /// 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, 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ExportsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ExportsDeleteViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ExportName) + { + 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.ExportsDelete(InputObject.Scope ?? null, InputObject.ExportName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzCostExport_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_Delete.cs b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_Delete.cs new file mode 100644 index 000000000000..80c0e019adc3 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_Delete.cs @@ -0,0 +1,411 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to delete a view. + /// + /// [OpenAPI] Delete=>DELETE:"/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzCostView_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to delete a view.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class RemoveAzCostView_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// View name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "View name")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"View name", + SerializedName = @"viewName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ViewName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ViewsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsDelete(Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzCostView_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name }) + { + 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 { Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_Delete1.cs b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_Delete1.cs new file mode 100644 index 000000000000..88c88ced85bc --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_Delete1.cs @@ -0,0 +1,435 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to delete a view. + /// + /// [OpenAPI] DeleteByScope=>DELETE:"/{scope}/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzCostView_Delete1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to delete a view.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class RemoveAzCostView_Delete1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// View name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "View name")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"View name", + SerializedName = @"viewName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ViewName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _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. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "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.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info( + Required = true, + ReadOnly = false, + 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) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ViewsDeleteByScope' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ViewsDeleteByScope(Scope, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzCostView_Delete1() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 }) + { + 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 }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_DeleteViaIdentity.cs b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_DeleteViaIdentity.cs new file mode 100644 index 000000000000..3a4bee879ef7 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_DeleteViaIdentity.cs @@ -0,0 +1,416 @@ +// 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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to delete a view. + /// + /// [OpenAPI] Delete=>DELETE:"/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzCostView_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to delete a view.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class RemoveAzCostView_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ViewsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ViewsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ViewName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ViewName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ViewsDelete(InputObject.ViewName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzCostView_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_DeleteViaIdentity1.cs b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_DeleteViaIdentity1.cs new file mode 100644 index 000000000000..b6b11120c016 --- /dev/null +++ b/swaggerci/cost-management/generated/cmdlets/RemoveAzCostView_DeleteViaIdentity1.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.Cost.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + using System; + + /// The operation to delete a view. + /// + /// [OpenAPI] DeleteByScope=>DELETE:"/{scope}/providers/Microsoft.CostManagement/views/{viewName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzCostView_DeleteViaIdentity1", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Description(@"The operation to delete a view.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Generated] + public partial class RemoveAzCostView_DeleteViaIdentity1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener + { + /// 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(); + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Cost.CostManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// 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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Cost.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.Cost.Models.Api20211001.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.Cost.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// 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.Cost.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.Cost.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Cost.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 ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ViewsDeleteByScope' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.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.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Cost.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ViewsDeleteByScopeViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ViewName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ViewName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ViewsDeleteByScope(InputObject.Scope ?? null, InputObject.ViewName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzCostView_DeleteViaIdentity1() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener)this).Cancel(); + base.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.Cost.Models.Api20211001.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.Cost.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml new file mode 100644 index 000000000000..ae0c12dd4efa --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml @@ -0,0 +1,496 @@ + + + + + AzureErrorRecords + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + AzureErrorRecords + + + $_.InvocationInfo.HistoryId + + + + + + + + ErrorCategory + + + ErrorDetail + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.BoundParameters + + + + $_.InvocationInfo.UnboundParameters + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord] + + + + + RequestId + + + Message + + + ServerMessage + + + ServerResponse + + + RequestMessage + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + StackTrace + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord] + + + + + Message + + + StackTrace + + + + $_.Exception.GetType() + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.HistoryId + + + + + + + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Description + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + Token + + + ExpiresOn + + + Type + + + TenantId + + + UserId + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + + + + Left + + + + Left + + + + Left + + + + + + + + Left + locationPlacementId + + + Left + QuotaId + + + Left + SpendingLimit + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + Id + + + Type + + + Tenants + + + Credential + + + TenantMap + + + CertificateThumbprint + + + + $_.ExtendedProperties.GetEnumerator() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..a81dae94b4db --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml @@ -0,0 +1,468 @@ + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + ResourceManagerUrl + + + Left + ActiveDirectoryAuthority + + + Left + Type + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Id + + + Left + TenantId + + + Left + State + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + $_.Context.Account.ToString() + + + Left + $_.Context.Subscription.Name + + + Left + $_.Context.Tenant.ToString() + + + Left + $_.Context.Environment.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + 40 + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Account + + + Left + $_.Subscription.Name + + + Left + Environment + + + Left + $_.Tenant.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Id + + + Left + $_.Name + + + Left + $_.TenantCategory + + + Left + $_.Domains + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml new file mode 100644 index 000000000000..e3b670a7daff --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml @@ -0,0 +1,303 @@ + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.AuthenticationStoreTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.ProtectedFileTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + Microsoft.Azure.Commands.Profile.Models.AzureContextConverter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec new file mode 100644 index 000000000000..f664d888f3b8 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec @@ -0,0 +1,20 @@ + + + + Az.Accounts + 2.7.5 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + * Added 'SshCredentialFactory' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + + \ No newline at end of file diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 new file mode 100644 index 000000000000..5597a247fce7 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 @@ -0,0 +1,387 @@ +# +# Module manifest for module 'Az.Accounts' +# +# Generated by: Microsoft Corporation +# +# Generated on: 3/31/2022 +# + +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'Az.Accounts.psm1' + +# Version number of this module. +ModuleVersion = '2.7.5' + +# Supported PSEditions +CompatiblePSEditions = 'Core', 'Desktop' + +# ID used to uniquely identify this module +GUID = '17a2feff-488b-47f9-8729-e2cec094624c' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps' + +# Minimum version of the PowerShell engine required by this module +PowerShellVersion = '5.1' + +# Name of the PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +DotNetFrameworkVersion = '4.7.2' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# ClrVersion = '' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +# RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = 'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll', + 'Microsoft.Azure.PowerShell.Authentication.dll', + 'Microsoft.Azure.PowerShell.Authenticators.dll', + 'Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Clients.Authorization.dll', + 'Microsoft.Azure.PowerShell.Clients.Compute.dll', + 'Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll', + 'Microsoft.Azure.PowerShell.Clients.Monitor.dll', + 'Microsoft.Azure.PowerShell.Clients.Network.dll', + 'Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll', + 'Microsoft.Azure.PowerShell.Clients.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Common.dll', + 'Microsoft.Azure.PowerShell.Storage.dll', + 'Microsoft.Azure.PowerShell.Clients.Storage.Management.dll', + 'Microsoft.Azure.PowerShell.Clients.KeyVault.dll', + 'Microsoft.Azure.PowerShell.Clients.Websites.dll', + 'Hyak.Common.dll', 'Microsoft.ApplicationInsights.dll', + 'Microsoft.Azure.Common.dll', 'Microsoft.Rest.ClientRuntime.dll', + 'Microsoft.Rest.ClientRuntime.Azure.dll', + 'Microsoft.WindowsAzure.Storage.dll', + 'Microsoft.WindowsAzure.Storage.DataMovement.dll', + 'Microsoft.Azure.PowerShell.Clients.Aks.dll', + 'Microsoft.Azure.PowerShell.Strategies.dll', + 'Microsoft.Azure.PowerShell.Common.Share.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = 'Accounts.format.ps1xml', 'Accounts.generated.format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @() + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = 'Disable-AzDataCollection', 'Disable-AzContextAutosave', + 'Enable-AzDataCollection', 'Enable-AzContextAutosave', + 'Remove-AzEnvironment', 'Get-AzEnvironment', 'Set-AzEnvironment', + 'Add-AzEnvironment', 'Get-AzSubscription', 'Connect-AzAccount', + 'Get-AzContext', 'Set-AzContext', 'Import-AzContext', 'Save-AzContext', + 'Get-AzTenant', 'Send-Feedback', 'Resolve-AzError', 'Select-AzContext', + 'Rename-AzContext', 'Remove-AzContext', 'Clear-AzContext', + 'Disconnect-AzAccount', 'Get-AzContextAutosaveSetting', + 'Set-AzDefault', 'Get-AzDefault', 'Clear-AzDefault', + 'Register-AzModule', 'Enable-AzureRmAlias', 'Disable-AzureRmAlias', + 'Uninstall-AzureRm', 'Invoke-AzRestMethod', 'Get-AzAccessToken', + 'Open-AzSurveyLink' + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = 'Add-AzAccount', 'Login-AzAccount', 'Remove-AzAccount', + 'Logout-AzAccount', 'Select-AzSubscription', 'Resolve-Error', + 'Save-AzProfile', 'Get-AzDomain', 'Invoke-AzRest' + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure','ResourceManager','ARM','Accounts','Authentication','Environment','Subscription' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + ReleaseNotes = '* Added ''SshCredentialFactory'' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment' + + # Prerelease string of this module + # Prerelease = '' + + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false + + # External dependent modules of this module + # ExternalModuleDependencies = @() + + } # End of PSData hashtable + + } # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} + + +# SIG # Begin signature block +# MIInoQYJKoZIhvcNAQcCoIInkjCCJ44CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBfih7Yjug0H4t7 +# yWl+P37e8ytBZAxLWrUP62/jyADYPKCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZdjCCGXICAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgXA6GKgxI +# VhLOuEe05JK0ofRRaS3Iixk8S4yAEDyheGcwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCk7+MONSYp7vxlpfSvtfVGPGdZ5LuxWlb4eimh/TgO +# qAAMDghpYUB8mFe46dAf/OoVHrcxhCfAof+aWlMkEqZTwIZ6p0XsXZ72jDLDFLgf +# WJNQ605jndPQx7/b3tDvqqI1sCHz4CvYnqiQn4/JpHjiE4321HRDFjhWv1lhTpMx +# Xaifyrvwc1OwLcSqMrEPSShevbYOH54J0MG+qI+t+AQ9D/WQdL/5HBJZ8PDZ2n9b +# I4FxGwm0aeTSnAiV602r8db+jebwv/5ypKfkok4IzN9qdQY1y3jXdP9MfEK2nCod +# Mbuby8eakQsarqZJovnvBOsZANYE8UafuSbYMQtJaEtnoYIXADCCFvwGCisGAQQB +# gjcDAwExghbsMIIW6AYJKoZIhvcNAQcCoIIW2TCCFtUCAQMxDzANBglghkgBZQME +# AgEFADCCAVEGCyqGSIb3DQEJEAEEoIIBQASCATwwggE4AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIPieBDiQ8jeOJOjc2VK1Wl36ph7izu7GPD9rSN/j +# BxeOAgZiFm2JbrQYEzIwMjIwMzMxMTAyMDU2LjYzNlowBIACAfSggdCkgc0wgcox +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJTAjBgNVBAsTHE1p +# Y3Jvc29mdCBBbWVyaWNhIE9wZXJhdGlvbnMxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOjEyQkMtRTNBRS03NEVCMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNloIIRVzCCBwwwggT0oAMCAQICEzMAAAGhAYVVmblUXYoAAQAAAaEw +# DQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwHhcN +# MjExMjAyMTkwNTI0WhcNMjMwMjI4MTkwNTI0WjCByjELMAkGA1UEBhMCVVMxEzAR +# BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p +# Y3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2Eg +# T3BlcmF0aW9uczEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046MTJCQy1FM0FFLTc0 +# RUIxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggIiMA0G +# CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDayTxe5WukkrYxxVuHLYW9BEWCD9kk +# jnnHsOKwGddIPbZlLY+l5ovLDNf+BEMQKAZQI3DX91l1yCDuP9X7tOPC48ZRGXA/ +# bf9ql0FK5438gIl7cV528XeEOFwc/A+UbIUfW296Omg8Z62xaQv3jrG4U/priArF +# /er1UA1HNuIGUyqjlygiSPwK2NnFApi1JD+Uef5c47kh7pW1Kj7RnchpFeY9MekP +# QRia7cEaUYU4sqCiJVdDJpefLvPT9EdthlQx75ldx+AwZf2a9T7uQRSBh8tpxPdI +# DDkKiWMwjKTrAY09A3I/jidqPuc8PvX+sqxqyZEN2h4GA0Edjmk64nkIukAK18K5 +# nALDLO9SMTxpAwQIHRDtZeTClvAPCEoy1vtPD7f+eqHqStuu+XCkfRjXEpX9+h9f +# rsB0/BgD5CBf3ELLAa8TefMfHZWEJRTPNrbXMKizSrUSkVv/3HP/ZsJpwaz5My2R +# byc3Ah9bT76eBJkyfT5FN9v/KQ0HnxhRMs6HHhTmNx+LztYci+vHf0D3QH1eCjZW +# ZRjp1mOyxpPU2mDMG6gelvJse1JzRADo7YIok/J3Ccbm8MbBbm85iogFltFHecHF +# EFwrsDGBFnNYHMhcbarQNA+gY2e2l9fAkX3MjI7Uklkoz74/P6KIqe5jcd9FPCbb +# SbYH9OLsteeYOQIDAQABo4IBNjCCATIwHQYDVR0OBBYEFBa/IDLbY475VQyKiZSw +# 47l0/cypMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8GA1UdHwRY +# MFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01p +# Y3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBsBggrBgEF +# BQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9w +# a2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAo +# MSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwgwDQYJKoZI +# hvcNAQELBQADggIBACDDIxElfXlG5YKcKrLPSS+f3JWZprwKEiASvivaHTBRlXtA +# s+TkadcsEei+9w5vmF5tCUzTH4c0nCI7bZxnsL+S6XsiOs3Z1V4WX+IwoXUJ4zLv +# s0+mT4vjGDtYfKQ/bsmJKar2c99m/fHv1Wm2CTcyaePvi86Jh3UyLjdRILWbtzs4 +# oImFMwwKbzHdPopxrBhgi+C1YZshosWLlgzyuxjUl+qNg1m52MJmf11loI7D9HJo +# aQzd+rf928Y8rvULmg2h/G50o+D0UJ1Fa/cJJaHfB3sfKw9X6GrtXYGjmM3+g+Ah +# aVsfupKXNtOFu5tnLKvAH5OIjEDYV1YKmlXuBuhbYassygPFMmNgG2Ank3drEcDc +# ZhCXXqpRszNo1F6Gu5JCpQZXbOJM9Ue5PlJKtmImAYIGsw+pnHy/r5ggSYOp4g5Z +# 1oU9GhVCM3V0T9adee6OUXBk1rE4dZc/UsPlj0qoiljL+lN1A5gkmmz7k5tIObVG +# B7dJdz8J0FwXRE5qYu1AdvauVbZwGQkL1x8aK/svjEQW0NUyJ29znDHiXl5vLoRT +# jjFpshUBi2+IY+mNqbLmj24j5eT+bjDlE3HmNtLPpLcMDYqZ1H+6U6YmaiNmac2j +# RXDAaeEE/uoDMt2dArfJP7M+MDv3zzNNTINeuNEtDVgm9zwfgIUCXnDZuVtiMIIH +# cTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTANBgkqhkiG9w0BAQsFADCB +# iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl +# ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMp +# TWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEw +# OTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UE +# CBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9z +# b2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQ +# Q0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOThpkzntHIh +# C3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDivbk+F2Az/1xPx2b3lVNx +# WuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5GawcU88V29YZQ3MFEyHFc +# UTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUmZNqYO7oaezOtgFt+jBAc +# nVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjksUZzpcGkNyjYtcI4xyDUo +# veO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvrg0XnRm7KMtXAhjBcTyzi +# YrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9 +# fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdH +# GO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7X +# KHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiE +# R9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/ +# eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHdMIIB2TASBgkrBgEEAYI3 +# FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAd +# BgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEE +# AYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMI +# MBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMB +# Af8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1Ud +# HwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3By +# b2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQRO +# MEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2Vy +# dHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4IC +# AQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pk +# bHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gng +# ugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe53Z/zjj3G82jfZfakVqr3 +# lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHC +# gRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6 +# MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEU +# BHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsNn6Qo3GcZKCS6OEuabvsh +# VGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+ +# fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrp +# NPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6gMTN9vMvpe784cETRkPHI +# qzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm8qGCAs4wggI3AgEBMIH4 +# oYHQpIHNMIHKMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUw +# IwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMSYwJAYDVQQLEx1U +# aGFsZXMgVFNTIEVTTjoxMkJDLUUzQUUtNzRFQjElMCMGA1UEAxMcTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUAG3F2jO4LEMVLwgKG +# XdYMN4FBgOCggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAN +# BgkqhkiG9w0BAQUFAAIFAOXvuD8wIhgPMjAyMjAzMzExMzE4NTVaGA8yMDIyMDQw +# MTEzMTg1NVowdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e+4PwIBADAKAgEAAgIP +# IwIB/zAHAgEAAgIRnzAKAgUA5fEJvwIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgor +# BgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUA +# A4GBANc53MLryLt1FD+jkakQydkemUps4QiN8HJxJ36VPuc2XRhvcn0Fhp1Pi8Hk +# gg08sFJoJ2vT/9g5J39zdjQpnbNGMkfmEi+qT6hbGq0ta5rnt1wDG2pVMuMn7N2Q +# 8CytKi6ZynWVbiCNuQtxsuwdgM7bRwcf510Wwp7iQUeNjJZzMYIEDTCCBAkCAQEw +# gZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAGhAYVVmblUXYoA +# AQAAAaEwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0B +# CRABBDAvBgkqhkiG9w0BCQQxIgQg7aLPwq2FhUC9oleuUeRc4uk9d+4UFLvls0ps +# 5tQU14wwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCDrCFTxOoGCaCCCjoRy +# Be1JSQrMJeCCTyErziiJ347QhDCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABoQGFVZm5VF2KAAEAAAGhMCIEIOKn52EgS+EFhqx/FxY8 +# xYD6qqUYqtVZ3iZ47g3sjJRaMA0GCSqGSIb3DQEBCwUABIICACJi4QGIi9yhn8uf +# NlWbdGQNP0UkTWxJRMnAe4eQUYbcHoOxPxguwy7r8VfTZOdKBxfy7/LKo5XGmAo2 +# hmZSsLHjtT0zzkZti2AFeCRmZ8DMVaGfR9sWBr0OwlRS3HMDigpWyI5jP/tD529k +# jh0/BYwKg2TGRk6ZmdFWXuQf0lVb/LytEUyFbziq4hoxhKc4IQ3oCcOm1xaVZzbe +# SgzPg3j4QfHAucYgfxJoIUP1lKTRclmUc2ERYmHchaUxeYIdiDHx5lpEdNsh0acm +# LgV307ncxLeN1Ih2E6By+Dknm8OppqVYOSvcjcjqHY+fU7ci/FuvyUVDQv6xe2ZS +# K6qCMCrPWtoOlE3ms+LE5kHVQ1JOs0v7mVVP8xfO+fkArk3RuUl/1gaGxi5Ljheg +# l+51jV5PMM4Vha9KoWfU2306ZLt/I1Rftq1sCOD5ysLnhTQuInQMRpfXlY/rvTPu +# 9jzQ4q4Ty7WPp004gh+9hLIm0s0nmZmM8jyTRUFrK1SfHglBOKgdrcuJfmEuPKxL +# foRg/LzuUjcXvdtO3oozIaVWsTxGx6laY2DkMPnqYaj/oBwla86bNyQT94YTTGWq +# 3mCwt0/H4E3Mn1OXLVIGO3NrzZwTFFN2uqRmcTQ0AKiXU3ar4b8F/ykpQOvTV6x/ +# U7Jz/JaISbEvO3mUarzheUPqVmWq +# SIG # End signature block diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 new file mode 100644 index 000000000000..67107181add7 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 @@ -0,0 +1,375 @@ +# +# Script module for module 'Az.Accounts' that is executed when 'Az.Accounts' is imported in a PowerShell session. +# +# Generated by: Microsoft Corporation +# +# Generated on: 03/31/2022 09:26:49 +# + +$PSDefaultParameterValues.Clear() +Set-StrictMode -Version Latest + +function Test-DotNet +{ + try + { + if ((Get-PSDrive 'HKLM' -ErrorAction Ignore) -and (-not (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' -ErrorAction Stop | Get-ItemPropertyValue -ErrorAction Stop -Name Release | Where-Object { $_ -ge 461808 }))) + { + throw ".NET Framework versions lower than 4.7.2 are not supported in Az. Please upgrade to .NET Framework 4.7.2 or higher." + } + } + catch [System.Management.Automation.DriveNotFoundException] + { + Write-Verbose ".NET Framework version check failed." + } +} + +function Preload-Assembly { + param ( + [string] + $AssemblyDirectory + ) + if($PSEdition -eq 'Desktop' -and (Test-Path $AssemblyDirectory -ErrorAction Ignore)) + { + try + { + Get-ChildItem -ErrorAction Stop -Path $AssemblyDirectory -Filter "*.dll" | ForEach-Object { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + catch {} + } +} + +if ($true -and ($PSEdition -eq 'Desktop')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'5.1') + { + throw "PowerShell versions lower than 5.1 are not supported in Az. Please upgrade to PowerShell 5.1 or higher." + } + + Test-DotNet +} + +if ($true -and ($PSEdition -eq 'Core')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'6.2.4') + { + throw "Current Az version doesn't support PowerShell Core versions lower than 6.2.4. Please upgrade to PowerShell Core 6.2.4 or higher." + } + if ($PSVersionTable.PSVersion -lt [Version]'7.0.6') + { + Write-Warning "This version of Az.Accounts is only supported on Windows PowerShell 5.1 and PowerShell 7.0.6 or greater, open https://aka.ms/install-powershell to learn how to upgrade. For further information, go to https://aka.ms/azpslifecycle." + } +} + +if (Test-Path -Path "$PSScriptRoot\StartupScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\StartupScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "PreloadAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "ModuleAlcAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath + +$netCorePath = (Join-Path $PSScriptRoot -ChildPath "NetCoreAssemblies") +if($PSEdition -eq 'Core' -and (Test-Path $netCorePath -ErrorAction Ignore)) +{ + try + { + $loadedAssemblies = ([System.AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object {New-Object -TypeName System.Reflection.AssemblyName -ArgumentList $_.FullName} ) + Get-ChildItem -ErrorAction Stop -Path $netCorePath -Filter "*.dll" | ForEach-Object { + $assemblyName = ([System.Reflection.AssemblyName]::GetAssemblyName($_.FullName)) + $matches = ($loadedAssemblies | Where-Object {$_.Name -eq $assemblyName.Name}) + if (-not $matches) + { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + } + catch {} +} + + +Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll) + + +if (Test-Path -Path "$PSScriptRoot\PostImportScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\PostImportScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +$FilteredCommands = @() + +if ($Env:ACC_CLOUD -eq $null) +{ + $FilteredCommands | ForEach-Object { + + $existingDefault = $false + foreach ($key in $global:PSDefaultParameterValues.Keys) + { + if ($_ -like "$key") + { + $existingDefault = $true + } + } + + if (!$existingDefault) + { + $global:PSDefaultParameterValues.Add($_, + { + if ((Get-Command Get-AzContext -ErrorAction Ignore) -eq $null) + { + $context = Get-AzureRmContext + } + else + { + $context = Get-AzContext + } + if (($context -ne $null) -and $context.ExtendedProperties.ContainsKey("Default Resource Group")) { + $context.ExtendedProperties["Default Resource Group"] + } + }) + } + } +} + +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBnXoRblwqGgp4a +# USzJaf5Wf+Tu+eUWmfecChJ7ENNasaCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgqwm8h/dw +# FED0y+xGCWSaD8Fc1mZMgPkryh2zfSvZwxIwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBvXNrKAkE7o84rJI6+XFvnA65dqlWCZBeFhG6YGpde +# Nom1mPdcfauabmxLKg7N5GG1FBWXuYDu1aEyDhiXzPG6ET+/ikXTGfN9J0D9g5Wx +# a2SeSIJ0XfsllBKKwOKl4OhoY3y5Kjjk08Cw75aE5BR8Ux0FWciN8n+nztakOyN9 +# tf7I5nmgbrHvJC5az2N9aR5DejRvjPDcNCnRkepz3nnA+FQNFbXaKqjgJz9oRBgA +# K2SAZDQnnK3B3MAv7qJX6GyeUhen7kwXZC0OV2RjyPRC+f8SiV/OF/ZsaFe4nXps +# RJqg5f5sUjCHFS5g8yK9Zy6D7EZKJJA4yk8YgRpdxOiuoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIAn/Ph2Du7oUABZfi9Z4pWXxedNUse800UpCJBeG +# +id6AgZiF5hUHpsYEzIwMjIwMzMxMTAwMDEyLjU2OFowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046RkM0MS00QkQ0LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY5Z20YAqBCU +# zAABAAABjjANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkZDNDEtNEJENC1EMjIwMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqiMCq6OM +# zLa5wrtcf7Bf9f1WXW9kpqbOBzgPJvaGLrZG7twgwqTRWf1FkjpJKBOG5QPIRy7a +# 6IFVAy0W+tBaFX4In4DbBf2tGubyY9+hRU+hRewPJH5CYOvpPh77FfGM63+OlwRX +# p5YER6tC0WRKn3mryWpt4CwADuGv0LD2QjnhhgtRVidsiDnn9+aLjMuNapUhstGq +# Cr7JcQZt0ZrPUHW/TqTJymeU1eqgNorEbTed6UQyLaTVAmhXNQXDChfa526nW7RQ +# 7L4tXX9Lc0oguiCSkPlu5drNA6NM8z+UXQOAHxVfIQXmi+Y3SV2hr2dcxby9nlTz +# Yvf4ZDr5Wpcwt7tTdRIJibXHsXWMKrmOziliGDToLx34a/ctZE4NOLnlrKQWN9ZG +# +Ox5zRarK1EhShahM0uQNhb6BJjp3+c0eNzMFJ2qLZqDp2/3Yl5Q+4k+MDHLTipP +# 6VBdxcdVfd4mgrVTx3afO5KNfgMngGGfhSawGraRW28EhrLOspmIxii92E7vjncJ +# 2tcjhLCjBArVpPh3cZG5g3ZVy5iiAaoDaswpNgnMFAK5Un1reK+MFhPi9iMnvUPw +# tTDDJt5YED5DAT3mBUxp5QH3t7RhZwAJNLWLtpTeGF7ub81sSKYv2ardazAe9XLS +# 10tV2oOPrcniGJzlXW7VPvxqQNxe8lCDA20CAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBTsQfkz9gT44N/5G8vNHayep+aV5DAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1UK9xzIeTlKhSbLn0bekR5gYh +# 6bB1XQpluCqCA15skZ37UilaFJw8+GklDLzlNhSP2mOiOzVyCq8kkpqnfUc01ZaB +# ezQxg77qevj2iMyg39YJfeiCIhxYOFugwepYrPO8MlB/oue/VhIiDb1eNYTlPSmv +# 3palsgtkrb0oo0F0uWmX4EQVGKRo0UENtZetVIxa0J9DpUdjQWPeEh9cEM+RgE26 +# 5w5WAVb+WNx0iWiF4iTbCmrWaVEOX92dNqBm9bT1U7nGwN5CygpNAgEaYnrTMx1N +# 4AjxObACDN5DdvGlu/O0DfMWVc6qk6iKDFC6WpXQSkMlrlXII/Nhp+0+noU6tfEp +# HKLt7fYm9of5i/QomcCwo/ekiOCjYktp393ovoC1O2uLtbLnMVlE5raBLBNSbINZ +# 6QLxiA41lXnVVLIzDihUL8MU9CMvG4sdbhk2FX8zvrsP5PeBIw1faenMZuz0V3UX +# CtU5Okx5fmioWiiLZSCi1ljaxX+BEwQiinCi+vE59bTYI5FbuR8tDuGLiVu/JSpV +# FXrzWMP2Kn11sCLAGEjqJYUmO1tRY29Kd7HcIj2niSB0PQOCjYlnCnywnDinqS1C +# XvRsisjVlS1Rp4Tmuks+pGxiMGzF58zcb+hoFKyONuL3b+tgxTAz3sF3BVX9uk9M +# 5F+OEoeyLyGfLekNAjCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046RkM0MS00QkQ0 +# LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAD1iK+pPThHqgpa5xsPmiYruWVuMoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl75AOMCIY +# DzIwMjIwMzMxMTAyNzI2WhgPMjAyMjA0MDExMDI3MjZaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvkA4CAQAwCgIBAAICAYUCAf8wBwIBAAICEiowCgIFAOXw4Y4C +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQCCQ+gyinUAzBfQG0tdRLTKoWAz +# 1F9XL8HUl1+DL/nO5fnfNT2fIwdNtkcnjXkY7J89nDVJ5orczCc/Jjd8FWrGsZYF +# R7jTDpEnctly2mdeOC54DPn8NfB2rKnTAZSMNZUA5+qwXYtBJ9/L+zBcWbLJGn17 +# Xdsy6ogPG2mqiNeJETGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjlnbRgCoEJTMAAEAAAGOMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIBdm +# /Yr/algho7Se4sS1u0RA1CsQ3avLfVkP9cSuIl4vMIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgvQWPITvigaUuV5+f/lWs3BXZwJ/l1mf+yelu5nXmxCUwgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY5Z20YAqBCU +# zAABAAABjjAiBCDFYh4a5uyi794y1CHlKx3P8nxZO/8fomUMsnns7kvKmzANBgkq +# hkiG9w0BAQsFAASCAgCphAx90HI/vzWSwneRSNg3gV826YqxCNSVkzMDcu1Rkayq +# 3FhK466ELhIxyI9EL3hLCS/BIQYKH8AiVU85P07pmaLls+bUM2CPt3II0oZYY5T8 +# BN/MyqZ0vUS6QvNX8ZT8A82R5/meSt8qS8+8ppG1XumAYmdqv7vriD8ENBrhIyus +# 3Wjwt0rS2kovNj+6g3xMJBU+LnP+qzNv72aEr2LvKkU8/abYiNXN1FGlJPqHYrF/ +# zumVFsNkJMjJrlgRFlo/EROGu3iUiI37hM7mTm77aYrWoMbKrl/4nKfMpjR4KQqL +# Mhi9Cb1c11cugxCFnoc1IA6kQ+Xg1fYUchz5UmgzDTpwic3FVGGRlTv4Wf9PMjjj +# heZyL7BFkHZCpr5qpwpu/ZvpCSQpsP4Aa07qY5ffgRu/te0ip3gkzL3Ur7zNqf60 +# Dw9If1ECZOcx+GMgIHd0t+48+hsE4RrmvMvWrEBz2B/BJEOfrIQEClhFczLjDd4G +# nhh4y/vSlqbUUupH+/oJRtpla+ZQbAxsg8jTPsiGG7hmvSaNfV7+SgwCjO1HB/On +# DkzS+edyqivrfkuwjFYecbLcl9e9Pr3SPFvelW5kXiQw2KyWFrD0aznq7YT0x/Na +# /XaZDuLepRVe7YnvH4Ky7yk58zG3QYNy5EJ6Pf3ClNsX4BBAJsUrWMxicmpUDg== +# SIG # End signature block diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..32652d6de4d0 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..f2955edfecb7 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..81b736cc09da Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..f656e5e42360 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..6f2a3e0ad07f Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..fe2154a3bf3a Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..92d06762d6a5 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll new file mode 100644 index 000000000000..1c9d8e2a0ef5 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll new file mode 100644 index 000000000000..8e791611cc1a Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json new file mode 100644 index 000000000000..dde9337e5748 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json @@ -0,0 +1,2309 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll new file mode 100644 index 000000000000..fcc5eb26eb20 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json new file mode 100644 index 000000000000..7828816a6777 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json @@ -0,0 +1,2273 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll new file mode 100644 index 000000000000..511cf6f6e630 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json new file mode 100644 index 000000000000..ce563dfdebbe --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json @@ -0,0 +1,1316 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v2.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v2.1": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netcoreapp2.1/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "System.Collections/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": {}, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": {}, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": {}, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "path": "microsoft.csharp/4.3.0", + "hashPath": "microsoft.csharp.4.3.0.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll new file mode 100644 index 000000000000..239999aa2f3c Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll new file mode 100644 index 000000000000..d966f6c302c5 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll new file mode 100644 index 000000000000..2667669dd3f4 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll new file mode 100644 index 000000000000..a11687928f60 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll new file mode 100644 index 000000000000..78fd60ad7aeb Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll new file mode 100644 index 000000000000..b33058d94c53 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll new file mode 100644 index 000000000000..e07270d24805 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll new file mode 100644 index 000000000000..6f489252bcac Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll new file mode 100644 index 000000000000..c19efdb8e00b Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll new file mode 100644 index 000000000000..0d443a2ecaaa Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll new file mode 100644 index 000000000000..482ccf22b352 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll new file mode 100644 index 000000000000..4bf3ee9bd78d Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json new file mode 100644 index 000000000000..54274e52ee76 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json @@ -0,0 +1,2413 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Authentication.ResourceManager": "1.0.0", + "Microsoft.Azure.PowerShell.Authenticators": "1.0.0", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0", + "System.Security.Permissions": "4.5.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.AccessControl/4.5.0": { + "dependencies": { + "System.Security.Principal.Windows": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Permissions/4.5.0": { + "dependencies": { + "System.Security.AccessControl": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Permissions.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Principal.Windows/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "dependencies": { + "Azure.Identity": "1.5.0", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authenticators.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.AccessControl/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vW8Eoq0TMyz5vAG/6ce483x/CP83fgm4SJe5P8Tb1tZaobcvPrbMEL7rhH1DRdrYbbb6F0vq3OlzmK0Pkwks5A==", + "path": "system.security.accesscontrol/4.5.0", + "hashPath": "system.security.accesscontrol.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.Permissions/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9gdyuARhUR7H+p5CjyUB/zPk7/Xut3wUSP8NJQB6iZr8L3XUXTMdoLeVAg9N4rqF8oIpE7MpdqHdDHQ7XgJe0g==", + "path": "system.security.permissions/4.5.0", + "hashPath": "system.security.permissions.4.5.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", + "path": "system.security.principal.windows/4.5.0", + "hashPath": "system.security.principal.windows.4.5.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll new file mode 100644 index 000000000000..2eff02a0138e Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml new file mode 100644 index 000000000000..85f85750523b --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml @@ -0,0 +1,11900 @@ + + + + + Add-AzEnvironment + Add + AzEnvironment + + Adds endpoints and metadata for an instance of Azure Resource Manager. + + + + The Add-AzEnvironment cmdlet adds endpoints and metadata to enable Azure Resource Manager cmdlets to connect with a new instance of Azure Resource Manager. The built-in environments AzureCloud and AzureChinaCloud target existing public instances of Azure Resource Manager. + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + AutoDiscover + + Discovers environments via default or configured endpoint. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AutoDiscover + + Discovers environments via default or configured endpoint. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : +VersionProfiles : {} +ExtendedProperties : {} +BatchEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + ------- Example 2: Discovering a new environment via Uri ------- + <# +Uri https://configuredmetadata.net returns an array of environment metadata. The following example contains a payload for the AzureCloud default environment. + +[ + { + "portal": "https://portal.azure.com", + "authentication": { + "loginEndpoint": "https://login.microsoftonline.com/", + "audiences": [ + "https://management.core.windows.net/" + ], + "tenant": "common", + "identityProvider": "AAD" + }, + "media": "https://rest.media.azure.net", + "graphAudience": "https://graph.windows.net/", + "graph": "https://graph.windows.net/", + "name": "AzureCloud", + "suffixes": { + "azureDataLakeStoreFileSystem": "azuredatalakestore.net", + "acrLoginServer": "azurecr.io", + "sqlServerHostname": ".database.windows.net", + "azureDataLakeAnalyticsCatalogAndJob": "azuredatalakeanalytics.net", + "keyVaultDns": "vault.azure.net", + "storage": "core.windows.net", + "azureFrontDoorEndpointSuffix": "azurefd.net" + }, + "batch": "https://batch.core.windows.net/", + "resourceManager": "https://management.azure.com/", + "vmImageAliasDoc": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json", + "activeDirectoryDataLake": "https://datalake.azure.net/", + "sqlManagement": "https://management.core.windows.net:8443/", + "gallery": "https://gallery.azure.com/" + }, +…… +] +#> + +Add-AzEnvironment -AutoDiscover -Uri https://configuredmetadata.net + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + In this example, we are discovering a new Azure environment from the `https://configuredmetadata.net` Uri. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/add-azenvironment + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Clear-AzContext + Clear + AzContext + + Remove all Azure credentials, account, and subscription information. + + + + Remove all Azure Credentials, account, and subscription information. + + + + Clear-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + --------------- Example 1: Clear global context --------------- + Clear-AzContext -Scope CurrentUser + + Remove all account, subscription, and credential information for any powershell session. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azcontext + + + + + + Clear-AzDefault + Clear + AzDefault + + Clears the defaults set by the user in the current context. + + + + The Clear-AzDefault cmdlet removes the defaults set by the user depending on the switch parameters specified by the user. + + + + Clear-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Clear-AzDefault + + This command removes all the defaults set by the user in the current context. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzDefault -ResourceGroup + + This command removes the default resource group set by the user in the current context. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azdefault + + + + + + Connect-AzAccount + Connect + AzAccount + + Connect to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. + + + + The `Connect-AzAccount` cmdlet connects to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. You can use this authenticated account only with Azure Resource Manager requests. To add an authenticated account for use with Service Management, use the `Add-AzureAccount` cmdlet from the Azure PowerShell module. If no context is found for the current user, the user's context list is populated with a context for each of their first 25 subscriptions. The list of contexts created for the user can be found by running `Get-AzContext -ListAvailable`. To skip this context population, specify the SkipContextPopulation switch parameter. After executing this cmdlet, you can disconnect from an Azure account using `Disconnect-AzAccount`. + + + + Connect-AzAccount + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + Identity + + Login using a Managed Service Identity. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + Identity + + Login using a Managed Service Identity. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------------ Example 1: Connect to an Azure account ------------ + Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 2: Connect to Azure using organizational ID credentials + $Credential = Get-Credential +Connect-AzAccount -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 3: Connect to Azure using a service principal account + $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $SecuredPassword +Connect-AzAccount -ServicePrincipal -TenantId $TenantId -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxx-xxxx-xxxx-xxxx Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 4: Use an interactive login to connect to a specific tenant and subscription + Connect-AzAccount -Tenant 'xxxx-xxxx-xxxx-xxxx' -SubscriptionId 'yyyy-yyyy-yyyy-yyyy' + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ----- Example 5: Connect using a Managed Service Identity ----- + Connect-AzAccount -Identity + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +MSI@50342 Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 6: Connect using Managed Service Identity login and ClientId + $identity = Get-AzUserAssignedIdentity -ResourceGroupName 'myResourceGroup' -Name 'myUserAssignedIdentity' +Get-AzVM -ResourceGroupName contoso -Name testvm | Update-AzVM -IdentityType UserAssigned -IdentityId $identity.Id +Connect-AzAccount -Identity -AccountId $identity.ClientId # Run on the virtual machine + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ------------ Example 7: Connect using certificates ------------ + $Thumbprint = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = '00000000-0000-0000-0000-00000000' +Connect-AzAccount -CertificateThumbprint $Thumbprint -ApplicationId $ApplicationId -Tenant $TenantId -ServicePrincipal + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + +Account : xxxxxxxx-xxxx-xxxx-xxxxxxxx +SubscriptionName : MyTestSubscription +SubscriptionId : zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz +TenantId : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy +Environment : AzureCloud + + + + + + + + -------------- Example 8: Connect with AuthScope -------------- + Connect-AzAccount -AuthScope Storage + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ---------- Example 9: Connect using certificate file ---------- + $securePassword = $plainPassword | ConvertTo-SecureString -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +Connect-AzAccount -ServicePrincipal -ApplicationId $ApplicationId -TenantId $TenantId -CertificatePath './certificatefortest.pfx' -CertificatePassword $securePassword + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/connect-azaccount + + + + + + Disable-AzContextAutosave + Disable + AzContextAutosave + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Disable-AzContextAutosave + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ---------- Example 1: Disable autosaving the context ---------- + Disable-AzContextAutosave + + Disable autosave for the current user. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Disable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azcontextautosave + + + + + + Disable-AzDataCollection + Disable + AzDataCollection + + Opts out of collecting data to improve the Azure PowerShell cmdlets. Data is collected by default unless you explicitly opt out. + + + + The `Disable-AzDataCollection` cmdlet is used to opt out of data collection. Azure PowerShell automatically collects telemetry data by default. To disable data collection, you must explicitly opt-out. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. If you've previously opted out, run the `Enable-AzDataCollection` cmdlet to re-enable data collection for the current user on the current machine. + + + + Disable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -- Example 1: Disabling data collection for the current user -- + Disable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azdatacollection + + + Enable-AzDataCollection + + + + + + + Disable-AzureRmAlias + Disable + AzureRmAlias + + Disables AzureRm prefix aliases for Az modules. + + + + Disables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases disabled. Otherwise all AzureRm aliases are disabled. + + + + Disable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Disable-AzureRmAlias + + Disables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Disable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Disables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azurermalias + + + + + + Disconnect-AzAccount + Disconnect + AzAccount + + Disconnects a connected Azure account and removes all credentials and contexts associated with that account. + + + + The Disconnect-AzAccount cmdlet disconnects a connected Azure account and removes all credentials and contexts (subscription and tenant information) associated with that account. After executing this cmdlet, you will need to login again using Connect-AzAccount. + + + + Disconnect-AzAccount + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + + + + + + + ----------- Example 1: Logout of the current account ----------- + Disconnect-AzAccount + + Logs out of the Azure account associated with the current context. + + + + + + Example 2: Logout of the account associated with a particular context + Get-AzContext "Work" | Disconnect-AzAccount -Scope CurrentUser + + Logs out the account associated with the given context (named 'Work'). Because this uses the 'CurrentUser' scope, all credentials and contexts will be permanently deleted. + + + + + + ------------- Example 3: Log out a particular user ------------- + Disconnect-AzAccount -Username 'user1@contoso.org' + + Logs out the 'user1@contoso.org' user - all credentials and all contexts associated with this user will be removed. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disconnect-azaccount + + + + + + Enable-AzContextAutosave + Enable + AzContextAutosave + + Azure contexts are PowerShell objects representing your active subscription to run commands against, and the authentication information needed to connect to an Azure cloud. With Azure contexts, Azure PowerShell doesn't need to reauthenticate your account each time you switch subscriptions. For more information, see Azure PowerShell context objects (https://docs.microsoft.com/powershell/azure/context-persistence). + This cmdlet allows the Azure context information to be saved and automatically loaded when you start a PowerShell process. For example, when opening a new window. + + + + Allows the Azure context information to be saved and automatically loaded when a PowerShell process starts. The context is saved at the end of the execution of any cmdlet that affects the context. For example, any profile cmdlet. If you're using user authentication, then tokens can be updated during the course of running any cmdlet. + + + + Enable-AzContextAutosave + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + Example 1: Enable autosaving credentials for the current user + Enable-AzContextAutosave + + + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Enable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azcontextautosave + + + + + + Enable-AzDataCollection + Enable + AzDataCollection + + Enables Azure PowerShell to collect data to improve the user experience with the Azure PowerShell cmdlets. Executing this cmdlet opts in to data collection for the current user on the current machine. Data is collected by default unless you explicitly opt out. + + + + The `Enable-AzDataCollection` cmdlet is used to opt in to data collection. Azure PowerShell automatically collects telemetry data by default. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. To disable data collection, you must explicitly opt out by executing `Disable-AzDataCollection`. + + + + Enable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + --- Example 1: Enabling data collection for the current user --- + Enable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azdatacollection + + + Disable-AzDataCollection + + + + + + + Enable-AzureRmAlias + Enable + AzureRmAlias + + Enables AzureRm prefix aliases for Az modules. + + + + Enables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases enabled. Otherwise all AzureRm aliases are enabled. + + + + Enable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + + Local + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Enable-AzureRmAlias + + Enables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Enable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Enables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azurermalias + + + + + + Get-AzAccessToken + Get + AzAccessToken + + Get raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. + + + + Get access token + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + + + + + + + + ------- Example 1 Get the access token for ARM endpoint ------- + Get-AzAccessToken + + Get access token of current account for ResourceManager endpoint + + + + + + - Example 2 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceTypeName MSGraph + + Get access token of Microsoft Graph endpoint for current account + + + + + + - Example 3 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceUrl "https://graph.microsoft.com/" + + Get access token of Microsoft Graph endpoint for current account + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azaccesstoken + + + + + + Get-AzContext + Get + AzContext + + Gets the metadata used to authenticate Azure Resource Manager requests. + + + + The Get-AzContext cmdlet gets the current metadata used to authenticate Azure Resource Manager requests. This cmdlet gets the Active Directory account, Active Directory tenant, Azure subscription, and the targeted Azure environment. Azure Resource Manager cmdlets use these settings by default when making Azure Resource Manager requests. When the available amount of subscription exceeds the default limit of 25, some subscriptions may not show up in the results of `Get-AzContext -ListAvailable`. Please run `Connect-AzAccount -MaxContextPopulation <int>` to get more contexts. + + + + Get-AzContext + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + + System.Management.Automation.SwitchParameter + + + False + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + + System.Management.Automation.SwitchParameter + + + False + + + + Get-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + The name of the context + + System.String + + System.String + + + None + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------------ Example 1: Getting the current context ------------ + Connect-AzAccount +Get-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + In this example we are logging into our account with an Azure subscription using Connect-AzAccount, and then we are getting the context of the current session by calling Get-AzContext. + + + + + + ---------- Example 2: Listing all available contexts ---------- + Get-AzContext -ListAvailable + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... +Subscription2 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription2 AzureCloud xxxxxxxx-x... +Subscription3 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription3 AzureCloud xxxxxxxx-x... + + In this example, all currently available contexts are displayed. The user may select one of these contexts using Select-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontext + + + Set-AzContext + + + + Connect-AzAccount + + + + + + + Get-AzContextAutosaveSetting + Get + AzContextAutosaveSetting + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Get-AzContextAutosaveSetting + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ------ Get context save metadata for the current session ------ + Get-AzContextAutosaveSetting + +Mode : Process +ContextDirectory : None +ContextFile : None +CacheDirectory : None +CacheFile : None +Settings : {} + + Get details about whether and where the context is saved. In the above example, the autosave feature has been disabled. + + + + + + -------- Get context save metadata for the current user -------- + Get-AzContextAutosaveSetting -Scope CurrentUser + +Mode : CurrentUser +ContextDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +ContextFile : AzureRmContext.json +CacheDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +CacheFile : TokenCache.dat +Settings : {} + + Get details about whether and where the context is saved by default for the current user. Note that this may be different than the settings that are active in the current session. In the above example, the autosave feature has been enabled, and data is saved to the default location. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontextautosavesetting + + + + + + Get-AzDefault + Get + AzDefault + + Get the defaults set by the user in the current context. + + + + The Get-AzDefault cmdlet gets the Resource Group that the user has set as default in the current context. + + + + Get-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzDefault + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current defaults if there are defaults set, or returns nothing if no default is set. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzDefault -ResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current default Resource Group if there is a default set, or returns nothing if no default is set. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azdefault + + + + + + Get-AzEnvironment + Get + AzEnvironment + + Get endpoints and metadata for an instance of Azure services. + + + + The Get-AzEnvironment cmdlet gets endpoints and metadata for an instance of Azure services. + + + + Get-AzEnvironment + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ---------- Example 1: Getting all Azure environments ---------- + Get-AzEnvironment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in +AzureGermanCloud https://management.microsoftazure.de/ https://login.microsoftonline.de/ Built-in +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in +AzureChinaCloud https://management.chinacloudapi.cn/ https://login.chinacloudapi.cn/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + -------- Example 2: Getting the AzureCloud environment -------- + Get-AzEnvironment -Name AzureCloud + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + ------ Example 3: Getting the AzureChinaCloud environment ------ + Get-AzEnvironment -Name AzureChinaCloud | Format-List + +Name : AzureChinaCloud +Type : Built-in +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : https://management.core.chinacloudapi.cn/ +AdTenant : Common +GalleryUrl : https://gallery.azure.com/ +ManagementPortalUrl : https://go.microsoft.com/fwlink/?LinkId=301902 +ServiceManagementUrl : https://management.core.chinacloudapi.cn/ +PublishSettingsFileUrl : https://go.microsoft.com/fwlink/?LinkID=301776 +ResourceManagerUrl : https://management.chinacloudapi.cn/ +SqlDatabaseDnsSuffix : .database.chinacloudapi.cn +StorageEndpointSuffix : core.chinacloudapi.cn +ActiveDirectoryAuthority : https://login.chinacloudapi.cn/ +GraphUrl : https://graph.chinacloudapi.cn/ +GraphEndpointResourceId : https://graph.chinacloudapi.cn/ +TrafficManagerDnsSuffix : trafficmanager.cn +AzureKeyVaultDnsSuffix : vault.azure.cn +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : https://vault.azure.cn +ContainerRegistryEndpointSuffix : azurecr.cn +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : asazure.chinacloudapi.cn +AnalysisServicesEndpointResourceId : https://region.asazure.chinacloudapi.cn +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : dev.azuresynapse.azure.cn +AzureSynapseAnalyticsEndpointResourceId : https://dev.azuresynapse.azure.cn + + This example shows how to get the endpoints and metadata for the AzureChinaCloud environment. + + + + + + ----- Example 4: Getting the AzureUSGovernment environment ----- + Get-AzEnvironment -Name AzureUSGovernment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in + + This example shows how to get the endpoints and metadata for the AzureUSGovernment environment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azenvironment + + + Add-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Get-AzSubscription + Get + AzSubscription + + Get subscriptions that the current account can access. + + + + The Get-AzSubscription cmdlet gets the subscription ID, subscription name, and home tenant for subscriptions that the current account can access. + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + + + + + ------- Example 1: Get all subscriptions in all tenants ------- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled +Subscription3 zzzz-zzzz-zzzz-zzzz bbbb-bbbb-bbbb-bbbb Enabled + + This command gets all subscriptions in all tenants that are authorized for the current account. + + + + + + ---- Example 2: Get all subscriptions for a specific tenant ---- + Get-AzSubscription -TenantId "aaaa-aaaa-aaaa-aaaa" + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + List all subscriptions in the given tenant that are authorized for the current account. + + + + + + ---- Example 3: Get all subscriptions in the current tenant ---- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + This command gets all subscriptions in the current tenant that are authorized for the current user. + + + + + + Example 4: Change the current context to use a specific subscription + Get-AzSubscription -SubscriptionId "xxxx-xxxx-xxxx-xxxx" -TenantId "yyyy-yyyy-yyyy-yyyy" | Set-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxx-xxxx-xxxx-xxxx) azureuser@micros... Subscription1 AzureCloud yyyy-yyyy-yyyy-yyyy + + This command gets the specified subscription, and then sets the current context to use it. All subsequent cmdlets in this session use the new subscription (Contoso Subscription 1) by default. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azsubscription + + + + + + Get-AzTenant + Get + AzTenant + + Gets tenants that are authorized for the current user. + + + + The Get-AzTenant cmdlet gets tenants authorized for the current user. + + + + Get-AzTenant + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + + + + + + + ---------------- Example 1: Getting all tenants ---------------- + Connect-AzAccount +Get-AzTenant + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} +yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Testhost Home testhost.onmicrosoft.com + + This example shows how to get all of the authorized tenants of an Azure account. + + + + + + ------------- Example 2: Getting a specific tenant ------------- + Connect-AzAccount +Get-AzTenant -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} + + This example shows how to get a specific authorized tenant of an Azure account. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-aztenant + + + + + + Import-AzContext + Import + AzContext + + Loads Azure authentication information from a file. + + + + The Import-AzContext cmdlet loads authentication information from a file to set the Azure environment and context. Cmdlets that you run in the current session use this information to authenticate requests to Azure Resource Manager. + + + + Import-AzContext + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Import-AzContext + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ----- Example 1: Importing a context from a AzureRmProfile ----- + Import-AzContext -AzContext (Connect-AzAccount) + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example imports a context from a PSAzureProfile that is passed through to the cmdlet. + + + + + + ------- Example 2: Importing a context from a JSON file ------- + Import-AzContext -Path C:\test.json + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example selects a context from a JSON file that is passed through to the cmdlet. This JSON file can be created from Save-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/import-azcontext + + + + + + Invoke-AzRestMethod + Invoke + AzRestMethod + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Invoke-AzRestMethod + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.string + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSHttpResponse + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Invoke-AzRestMethod -Path "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}?api-version={API}" -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [x-ms-request-id, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : { + "properties": { + "source": "Azure", + "customerId": "{customerId}", + "provisioningState": "Succeeded", + "sku": { + "name": "pergb2018", + "maxCapacityReservationLevel": 3000, + "lastSkuUpdate": "Mon, 25 May 2020 11:10:01 GMT" + }, + "retentionInDays": 30, + "features": { + "legacy": 0, + "searchVersion": 1, + "enableLogAccessUsingOnlyResourcePermissions": true + }, + "workspaceCapping": { + "dailyQuotaGb": -1.0, + "quotaNextResetTime": "Thu, 18 Jun 2020 05:00:00 GMT", + "dataIngestionStatus": "RespectQuota" + }, + "enableFailover": false, + "publicNetworkAccessForIngestion": "Enabled", + "publicNetworkAccessForQuery": "Enabled", + "createdDate": "Mon, 25 May 2020 11:10:01 GMT", + "modifiedDate": "Mon, 25 May 2020 11:10:02 GMT" + }, + "id": "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}", + "name": "{workspace}", + "type": "Microsoft.OperationalInsights/workspaces", + "location": "eastasia", + "tags": {} + } + + Get log analytics workspace by path. It only supports management plane API and Hostname of Azure Resource Manager is added according to Azure environment setting. + + + + + + + -------------------------- Example 2 -------------------------- + Invoke-AzRestMethod https://graph.microsoft.com/v1.0/me + +Headers : {[Date, System.String[]], [Cache-Control, System.String[]], [Transfer-Encoding, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":["......} + + Get current signed in user via MicrosoftGraph API. This example is equivalent to `Get-AzADUser -SignedIn`. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/invoke-azrestmethod + + + + + + Open-AzSurveyLink + Open + AzSurveyLink + + Open survey link in default browser. + + + + Open survey link in default browser. + + + + Open-AzSurveyLink + + + + + + + None + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Open-AzSurveyLink + +Opening the default browser to https://aka.ms/azpssurvey?Q_CHL=INTERCEPT + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/open-azsurveylink + + + + + + Register-AzModule + Register + AzModule + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + Register-AzModule + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Register-AzModule + + Used Internally by AutoRest-generated cmdlets + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/register-azmodule + + + + + + Remove-AzContext + Remove + AzContext + + Remove a context from the set of available contexts + + + + Remove an azure context from the set of contexts + + + + Remove-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Remove-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + PassThru + + Return the removed context + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AzContext -Name Default + + Remove the context named default + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azcontext + + + + + + Remove-AzEnvironment + Remove + AzEnvironment + + Removes endpoints and metadata for connecting to a given Azure instance. + + + + The Remove-AzEnvironment cmdlet removes endpoints and metadata information for connecting to a given Azure instance. + + + + Remove-AzEnvironment + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and removing a test environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Remove-AzEnvironment -Name TestEnvironment + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + This example shows how to create an environment using Add-AzEnvironment, and then how to delete the environment using Remove-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Rename-AzContext + Rename + AzContext + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename-AzContext + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Rename-AzContext + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------ Example 1: Rename a context using named parameters ------ + Rename-AzContext -SourceName "[user1@contoso.org; 12345-6789-2345-3567890]" -TargetName "Work" + + Rename the context for 'user1@contoso.org' with subscription '12345-6789-2345-3567890' to 'Work'. After this command, you will be able to target the context using 'Select-AzContext Work'. Note that you can tab through the values for 'SourceName' using tab completion. + + + + + + --- Example 2: Rename a context using positional parameters --- + Rename-AzContext "My context" "Work" + + Rename the context named "My context" to "Work". After this command, you will be able to target the context using Select-AzContext Work + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/rename-azcontext + + + + + + Resolve-AzError + Resolve + AzError + + Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors. + + + + Resolves and displays detailed information about errors in the current PowerShell session, including where the error occurred in script, stack trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides additional detail in debugging service issues, including complete detail about the request and server response that caused the error. + + + + Resolve-AzError + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + Resolve-AzError + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Last + + Resolve only the last error that occurred in the session. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + Last + + Resolve only the last error that occurred in the session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.ErrorRecord[] + + + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + + + + + + + + + -------------- Example 1: Resolve the Last Error -------------- + Resolve-AzError -Last + +HistoryId: 3 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in AzureRmCmdlet.cs:line 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() inAzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 3 + + Get details of the last error. + + + + + + --------- Example 2: Resolve all Errors in the Session --------- + Resolve-AzError + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + + HistoryId: 5 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in C:\zd\azur + e-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in + C:\zd\azure-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:lin + e 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in C:\zd\azure-p + owershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in C:\zd\azure- + powershell\src\ResourceManager\Profile\Commands.Profile\Subscription\GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 5 + + Get details of all errors that have occurred in the current session. + + + + + + ------------- Example 3: Resolve a Specific Error ------------- + Resolve-AzError $Error[0] + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + Get details of the specified error. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/resolve-azerror + + + + + + Save-AzContext + Save + AzContext + + Saves the current authentication information for use in other PowerShell sessions. + + + + The Save-AzContext cmdlet saves the current authentication information for use in other PowerShell sessions. + + + + Save-AzContext + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------- Example 1: Saving the current session's context ------- + Connect-AzAccount +Save-AzContext -Path C:\test.json + + This example saves the current session's Azure context to the JSON file provided. + + + + + + -------------- Example 2: Saving a given context -------------- + Save-AzContext -Profile (Connect-AzAccount) -Path C:\test.json + + This example saves the Azure context that is passed through to the cmdlet to the JSON file provided. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/save-azcontext + + + + + + Select-AzContext + Select + AzContext + + Select a subscription and account to target in Azure PowerShell cmdlets + + + + Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the selected context. + + + + Select-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Select-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------- Example 1: Target a named context -------------- + Select-AzContext "Work" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Select-AzContext -Name TestEnvironment -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/select-azcontext + + + + + + Send-Feedback + Send + Feedback + + Sends feedback to the Azure PowerShell team via a set of guided prompts. + + + + The Send-Feedback cmdlet sends feedback to the Azure PowerShell team. + + + + Send-Feedback + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -------------------------- Example 1: -------------------------- + Send-Feedback + +With zero (0) being the least and ten (10) being the most, how likely are you to recommend Azure PowerShell to a friend or colleague? + +10 + +What does Azure PowerShell do well? + +Response. + +Upon what could Azure PowerShell improve? + +Response. + +Please enter your email if you are interested in providing follow up information: + +your@email.com + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/send-feedback + + + + + + Set-AzContext + Set + AzContext + + Sets the tenant, subscription, and environment for cmdlets to use in the current session. + + + + The Set-AzContext cmdlet sets authentication information for cmdlets that you run in the current session. The context includes tenant, subscription, and environment information. + + + + Set-AzContext + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ----------- Example 1: Set the subscription context ----------- + Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + This command sets the context to use the specified subscription. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azcontext + + + Get-AzContext + + + + + + + Set-AzDefault + Set + AzDefault + + Sets a default in the current context + + + + The Set-AzDefault cmdlet adds or changes the defaults in the current context. + + + + Set-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Set-AzDefault -ResourceGroupName myResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command sets the default resource group to the resource group specified by the user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azdefault + + + + + + Set-AzEnvironment + Set + AzEnvironment + + Sets properties for an Azure environment. + + + + The Set-AzEnvironment cmdlet sets endpoints and metadata for connecting to an instance of Azure. + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +BatchEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureOperationalInsightsEndpointResourceId : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + + + + Uninstall-AzureRm + Uninstall + AzureRm + + Removes all AzureRm modules from a machine. + + + + Removes all AzureRm modules from a machine. + + + + Uninstall-AzureRm + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Uninstall-AzureRm + + Running this command will remove all AzureRm modules from the machine for the version of PowerShell in which the cmdlet is run. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/uninstall-azurerm + + + + \ No newline at end of file diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll new file mode 100644 index 000000000000..e45ac91a1264 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll new file mode 100644 index 000000000000..a705c3fd25a8 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll new file mode 100644 index 000000000000..f15127c61779 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll new file mode 100644 index 000000000000..f82770a9ceed Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll new file mode 100644 index 000000000000..1d99c7015912 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll new file mode 100644 index 000000000000..4b4be00999a4 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 000000000000..6ac672abd486 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 000000000000..70c5ed6806c6 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..bb0bc9e63f5d --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 @@ -0,0 +1,219 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } catch {} +} +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBn8ROze2QLH/c6 +# GtPhR/BPLgOtmjkNhcq+fFmu16VcrqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgLwxfLTEa +# f5cZ43nGFJSGxV1AZMu24c5Ln5TdSBDWTncwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCH+MB7uS3RlpbV8q8Nvg9aa0UmWWYCFOT/3n7V09Q6 +# p3v/uFdZ8AXCe8zdAeWFwLOQg9974QcDbIbvXm1V96+Z7zEEimU/Zr1ou5Cv0knI +# riaKdejplgnDt1EnBE9JlSyVsV7aOYr4EueMCb1Xn1dfGabKcgVlJUlP0JyZPQfs +# YqsyxEznkgNE769m8ozUwCx33jJN1Llcs3FYEe5irzu8UthSkFQ8vpG3YABhlk6M +# 4jPeb38LKbkEE0jclq6sfdmT+JL8j7Z05KfgaD076LnpSaqkcu9+2RH3TARosqhq +# I/N3nhDQclKIl1kYSXFG1E4/6ea3rAa98adIaR0YNcpFoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIDsI/xX4lqk74CTV97lUQ0iyAOiIu4ggTwVzbGvl +# +HKeAgZiMTFcH0UYEzIwMjIwMzMxMTAwMDA5LjQ1OVowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY16VS54dJkq +# twABAAABjTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkEyNDAtNEI4Mi0xMzBFMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2jRILZg+ +# O6U7dLcuwBPMB+0tJUz0wHLqJ5f7KJXQsTzWToADUMYV4xVZnp9mPTWojUJ/l3O4 +# XqegLDNduFAObcitrLyY5HDsxAfUG1/2YilcSkSP6CcMqWfsSwULGX5zlsVKHJ7t +# vwg26y6eLklUdFMpiq294T4uJQdXd5O7mFy0vVkaGPGxNWLbZxKNzqKtFnWQ7jMt +# Z05XvafkIWZrNTFv8GGpAlHtRsZ1A8KDo6IDSGVNZZXbQs+fOwMOGp/Bzod8f1YI +# 8Gb2oN/mx2ccvdGr9la55QZeVsM7LfTaEPQxbgAcLgWDlIPcmTzcBksEzLOQsSpB +# zsqPaWI9ykVw5ofmrkFKMbpQT5EMki2suJoVM5xGgdZWnt/tz00xubPSKFi4B4IM +# FUB9mcANUq9cHaLsHbDJ+AUsVO0qnVjwzXPYJeR7C/B8X0Ul6UkIdplZmncQZSBK +# 3yZQy+oGsuJKXFAq3BlxT6kDuhYYvO7itLrPeY0knut1rKkxom+ui6vCdthCfnAi +# yknyRC2lknqzz8x1mDkQ5Q6Ox9p6/lduFupSJMtgsCPN9fIvrfppMDFIvRoULsHO +# dLJjrRli8co5M+vZmf20oTxYuXzM0tbRurEJycB5ZMbwznsFHymOkgyx8OeFnXV3 +# car45uejI1B1iqUDbeSNxnvczuOhcpzwackCAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBR4zJFuh59GwpTuSju4STcflihmkzAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1r3Oz0lEq3VvpdFlh3YBxc4hn +# YkALyYPDa9FO4XgqwkBm8Lsb+lK3tbGGgpi6QJbK3iM3BK0ObBcwRaJVCxGLGtr6 +# Jz9hRumRyF8o4n2y3YiKv4olBxNjFShSGc9E29JmVjBmLgmfjRqPc/2rD25q4ow4 +# uA3rc9ekiaufgGhcSAdek/l+kASbzohOt/5z2+IlgT4e3auSUzt2GAKfKZB02ZDG +# WKKeCY3pELj1tuh6yfrOJPPInO4ZZLW3vgKavtL8e6FJZyJoDFMewJ59oEL+AK3e +# 2M2I4IFE9n6LVS8bS9UbMUMvrAlXN5ZM2I8GdHB9TbfI17Wm/9Uf4qu588PJN7vC +# Jj9s+KxZqXc5sGScLgqiPqIbbNTE+/AEZ/eTixc9YLgTyMqakZI59wGqjrONQSY7 +# u0VEDkEE6ikz+FSFRKKzpySb0WTgMvWxsLvbnN8ACmISPnBHYZoGssPAL7foGGKF +# LdABTQC2PX19WjrfyrshHdiqSlCspqIGBTxRaHtyPMro3B/26gPfCl3MC3rC3NGq +# 4xGnIHDZGSizUmGg8TkQAloVdU5dJ1v910gjxaxaUraGhP8IttE0RWnU5XRp/sGa +# NmDcMwbyHuSpaFsn3Q21OzitP4BnN5tprHangAC7joe4zmLnmRnAiUc9sRqQ2bms +# MAvUpsO8nlOFmiM1LzCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046QTI0MC00Qjgy +# LTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAIBzlZM9TRND4PgtpLWQZkSPYVcJoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl73XWMCIY +# DzIwMjIwMzMxMDgzNTM0WhgPMjAyMjA0MDEwODM1MzRaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvddYCAQAwCgIBAAICF6kCAf8wBwIBAAICER8wCgIFAOXwx1YC +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQAY60kde7HWABLbM75dgVqLPwu2 +# UX3qQDaoStTqkS7953pYHKc6GEqRd/nLCCeYBqC+XJRMTMNbd4ZDkkCzsxlr5HFi +# GE6eT7+KvwqQf+djK59ZAts0no9RPZcdCJwQfvqU3RK91gp/Sg2bCMvAfTN4LRGp +# qQ4tYYP2GrJJNqVbkDGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3AAEAAAGNMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIOQz +# W64DlGXuO2zRgqB/n+gyoReL9ldfVdiKRVTSCDK+MIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgnpYRM/odXkDAnzf2udL569W8cfGTgwVuenQ8ttIYzX8wgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY16VS54dJkq +# twABAAABjTAiBCCgvCueU3dRfCsOKSpG5oksOx2/8SHFEjSLBygedl9oUzANBgkq +# hkiG9w0BAQsFAASCAgASDKu2OAv74hH075B2jN90FtXMtuST3zF61GC5OXm38b4j +# NSjLjbMslJJqeXiyODEQFNxmdE9AgPguQK13CeNnqsx2krlMfIC4o+M2pN7lqWCk +# gWfp5QemsmucuotA2dXLF98jGlQ1JShvFVOvUyxs0QKejf323B/mYdoUzvKurP1M +# k+FUjq/w3mgN9oj5oHoCIkdg1gDWNh80zEa0/YxEE7YYzg8bPLsGpK+f7B75Q51Y +# Sz7Gp/LGpQiG/LjytNQmsHwy/bl3FCr5/2WxBkAs8BneisPIfNLW0gfEo5Azkjo9 +# KEm5l8ILkJ3/4Qx9HiGjqwrdto8kGWAlGoIELtsO0BGT4onF4ynlKQgw82JK+4RD +# tWXCnPqjojkl+/4tfbeEdUoPvNgYpvS6ZRRYJIWg5s7XViroohZCCSkqt8aMjTZF +# HJBsKzmdHvVvAGELQ7TKaN3mOMUXb/o4vIK0TYrYN6FUn5iVnA7X2LIbJj0j3Mef +# BwEeOFhSjxz2Ob1oihNBoR1v5y+XfkbT7igIVQqwM27ujcOooOsDkpgizs0FajJV +# jeRsqEsXgfpaKCAq5czpOTutrvvwEn/cINrR3JW1TRSGt3VUvSWkmBs1T+7Oj6H6 +# ewWQaQIDYdEiDUL8OJhl+GzebujxPo//NXTY0MZCxK3DXhXi5okwsImzh5010w== +# SIG # End signature block diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..67edb79248ca Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..869ac1b86c57 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..d22ddefa2339 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..7f392562319f Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll new file mode 100644 index 000000000000..6344999edbb3 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll new file mode 100644 index 000000000000..9b0ae142146e Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll new file mode 100644 index 000000000000..c517a3b62cc7 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 000000000000..a2b54fb042de Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..5aa381018c00 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll new file mode 100644 index 000000000000..bdfc501e9647 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll new file mode 100644 index 000000000000..8bd471e74c6e Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll new file mode 100644 index 000000000000..08659724d4f8 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll new file mode 100644 index 000000000000..3f9f84edf0ed Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll new file mode 100644 index 000000000000..64a57cbbecce Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 000000000000..0c27a0e21c7e Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll new file mode 100644 index 000000000000..e8074324cd13 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll new file mode 100644 index 000000000000..4f4c30e080bd Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll new file mode 100644 index 000000000000..d1af38f0f8b7 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll new file mode 100644 index 000000000000..afd187c14918 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll new file mode 100644 index 000000000000..c1aa0a64f8f9 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll new file mode 100644 index 000000000000..6d2b207854ac Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..a3a85c2b7255 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll new file mode 100644 index 000000000000..dfab23478ab4 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll new file mode 100644 index 000000000000..022e63a21a86 Binary files /dev/null and b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..f234bd2dd7e5 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 @@ -0,0 +1,278 @@ +function Write-InstallationCheckToFile +{ + Param($installationchecks) + if (Get-Module AzureRM.Profile -ListAvailable -ErrorAction Ignore) + { + Write-Warning ("Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide") + } + + $installationchecks.Add("AzSideBySideCheck","true") + try + { + if (Test-Path $pathToInstallationChecks -ErrorAction Ignore) + { + Remove-Item -Path $pathToInstallationChecks -ErrorAction Stop + } + + $pathToInstallDir = Split-Path -Path $pathToInstallationChecks -Parent -ErrorAction Stop + if (Test-Path $pathToInstallDir -ErrorAction Ignore) + { + New-Item -Path $pathToInstallationChecks -ErrorAction Stop -ItemType File -Value ($installationchecks | ConvertTo-Json -ErrorAction Stop) + } + } + catch + { + Write-Verbose "Installation checks failed to write to file." + } +} + +if (!($env:SkipAzInstallationChecks -eq "true")) +{ + $pathToInstallationChecks = Join-Path (Join-Path $HOME ".Azure") "AzInstallationChecks.json" + $installationchecks = @{} + if (!(Test-Path $pathToInstallationChecks -ErrorAction Ignore)) + { + Write-InstallationCheckToFile $installationchecks + } + else + { + try + { + ((Get-Content $pathToInstallationChecks -ErrorAction Stop) | ConvertFrom-Json -ErrorAction Stop).PSObject.Properties | Foreach { $installationchecks[$_.Name] = $_.Value } + } + catch + { + Write-InstallationCheckToFile $installationchecks + } + + if (!$installationchecks.ContainsKey("AzSideBySideCheck")) + { + Write-InstallationCheckToFile $installationchecks + } + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +Update-TypeData -AppendPath (Join-Path (Get-Item $PSScriptRoot).Parent.FullName Accounts.types.ps1xml) -ErrorAction Ignore +# SIG # Begin signature block +# MIInuQYJKoZIhvcNAQcCoIInqjCCJ6YCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDT3s8rOGw0kP8l +# AbYXJ7G9hr2fOKBRtW5xO6fWVEOZvqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjjCCGYoCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgpH7D8Not +# WnytrY9dBBVdkjoPJbp/Jb5/OaJtNH+9PHMwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBeESsu04jkAEIOu00+XAL5Cw3b4lPK1+Y/A63nt7uC +# g0IvVE66lSl52+b6CVBX/G72fi7HlOIYoCyVKEIasUVN+dqAtdM2ib0RLRPrWxH9 +# 2axBlgxQg9nBAZkklffNIZjmkC+gZN37i3g0DHSwmb1ej9OwHDD0MYQpF8oIa81e +# oj07j6dAzRwVM0TaHEJj9kPXA81HN6CAYBJ/V3p0wYRbp3c2L9j2R9MtVVvnx/7z +# sbKvHJV+l3b/xCT5T0/J5l5QoLzzNyfWB7Zvaz0DbKX1bln/rcb8uPYKVEz4wsKW +# 5zAm12WLQ87vxiIGLA6tv4lXxggEAUm68Nwjfw6vqkHRoYIXGDCCFxQGCisGAQQB +# gjcDAwExghcEMIIXAAYJKoZIhvcNAQcCoIIW8TCCFu0CAQMxDzANBglghkgBZQME +# AgEFADCCAVgGCyqGSIb3DQEJEAEEoIIBRwSCAUMwggE/AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIEbwTnYvqLH2wAcLSr8ZwikKunQnLTH8PEiqd0Vr +# sTtWAgZiMTFcHxoYEjIwMjIwMzMxMTAwMDA4Ljg4WjAEgAIB9KCB2KSB1TCB0jEL +# MAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v +# bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWlj +# cm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFs +# ZXMgVFNTIEVTTjpBMjQwLTRCODItMTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgU2VydmljZaCCEWgwggcUMIIE/KADAgECAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpX +# YXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQg +# Q29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAy +# MDEwMB4XDTIxMTAyODE5Mjc0NVoXDTIzMDEyNjE5Mjc0NVowgdIxCzAJBgNVBAYT +# AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYD +# VQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJ +# cmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBF +# U046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFNlcnZpY2UwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDaNEgtmD47 +# pTt0ty7AE8wH7S0lTPTAcuonl/soldCxPNZOgANQxhXjFVmen2Y9NaiNQn+Xc7he +# p6AsM124UA5tyK2svJjkcOzEB9QbX/ZiKVxKRI/oJwypZ+xLBQsZfnOWxUocnu2/ +# CDbrLp4uSVR0UymKrb3hPi4lB1d3k7uYXLS9WRoY8bE1YttnEo3Ooq0WdZDuMy1n +# Tle9p+QhZms1MW/wYakCUe1GxnUDwoOjogNIZU1lldtCz587Aw4an8HOh3x/Vgjw +# Zvag3+bHZxy90av2VrnlBl5Wwzst9NoQ9DFuABwuBYOUg9yZPNwGSwTMs5CxKkHO +# yo9pYj3KRXDmh+auQUoxulBPkQySLay4mhUznEaB1lae3+3PTTG5s9IoWLgHggwV +# QH2ZwA1Sr1wdouwdsMn4BSxU7SqdWPDNc9gl5HsL8HxfRSXpSQh2mVmadxBlIErf +# JlDL6gay4kpcUCrcGXFPqQO6Fhi87uK0us95jSSe63WsqTGib66Lq8J22EJ+cCLK +# SfJELaWSerPPzHWYORDlDo7H2nr+V24W6lIky2CwI8318i+t+mkwMUi9GhQuwc50 +# smOtGWLxyjkz69mZ/bShPFi5fMzS1tG6sQnJwHlkxvDOewUfKY6SDLHw54WddXdx +# qvjm56MjUHWKpQNt5I3Ge9zO46FynPBpyQIDAQABo4IBNjCCATIwHQYDVR0OBBYE +# FHjMkW6Hn0bClO5KO7hJNx+WKGaTMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMF8GA1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNv +# bS9wa2lvcHMvY3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEw +# KDEpLmNybDBsBggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFt +# cCUyMFBDQSUyMDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwDQYJKoZIhvcNAQELBQADggIBADWvc7PSUSrdW+l0WWHdgHFziGdi +# QAvJg8Nr0U7heCrCQGbwuxv6Ure1sYaCmLpAlsreIzcErQ5sFzBFolULEYsa2von +# P2FG6ZHIXyjifbLdiIq/iiUHE2MVKFIZz0Tb0mZWMGYuCZ+NGo9z/asPbmrijDi4 +# Detz16SJq5+AaFxIB16T+X6QBJvOiE63/nPb4iWBPh7dq5JTO3YYAp8pkHTZkMZY +# op4JjekQuPW26HrJ+s4k88ic7hlktbe+Apq+0vx7oUlnImgMUx7Ann2gQv4Ard7Y +# zYjggUT2fotVLxtL1RsxQy+sCVc3lkzYjwZ0cH1Nt8jXtab/1R/iq7nzw8k3u8Im +# P2z4rFmpdzmwZJwuCqI+ohts1MT78ARn95OLFz1guBPIypqRkjn3AaqOs41BJju7 +# RUQOQQTqKTP4VIVEorOnJJvRZOAy9bGwu9uc3wAKYhI+cEdhmgayw8Avt+gYYoUt +# 0AFNALY9fX1aOt/KuyEd2KpKUKymogYFPFFoe3I8yujcH/bqA98KXcwLesLc0arj +# EacgcNkZKLNSYaDxORACWhV1Tl0nW/3XSCPFrFpStoaE/wi20TRFadTldGn+wZo2 +# YNwzBvIe5KloWyfdDbU7OK0/gGc3m2msdqeAALuOh7jOYueZGcCJRz2xGpDZuaww +# C9Smw7yeU4WaIzUvMIIHcTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTAN +# BgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y +# aXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCC +# AgoCggIBAOThpkzntHIhC3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDi +# vbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5G +# awcU88V29YZQ3MFEyHFcUTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUm +# ZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjks +# UZzpcGkNyjYtcI4xyDUoveO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvr +# g0XnRm7KMtXAhjBcTyziYrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31B +# mkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PR +# c6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRR +# RuLRvWoYWmEBc8pnol7XKHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSR +# lJTYuVD5C4lh8zYGNRiER9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflS +# xIUXk8A8FdsaN8cIFRg/eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHd +# MIIB2TASBgkrBgEEAYI3FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSa +# voKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYD +# VR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1Ud +# JQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjR +# PZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNy +# bDBaBggrBgEFBQcBAQROMEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9z +# b2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0G +# CSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHix +# BpOXPTEztTnXwnE2P9pkbHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjY +# Ni6cqYJWAAOwBb6J6Gngugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe5 +# 3Z/zjj3G82jfZfakVqr3lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BU +# hUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QM +# vOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1A +# PMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsN +# n6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFs +# c/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue1 +# 0CgaiQuPNtq6TPmb/wrpNPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6g +# MTN9vMvpe784cETRkPHIqzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm +# 8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB0jELMAkGA1UEBhMCVVMxEzARBgNVBAgT +# Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m +# dCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxhbmQgT3BlcmF0 +# aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpBMjQwLTRCODIt +# MTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEB +# MAcGBSsOAwIaAxUAgHOVkz1NE0Pg+C2ktZBmRI9hVwmggYMwgYCkfjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXvddYwIhgP +# MjAyMjAzMzEwODM1MzRaGA8yMDIyMDQwMTA4MzUzNFowdzA9BgorBgEEAYRZCgQB +# MS8wLTAKAgUA5e911gIBADAKAgEAAgIXqQIB/zAHAgEAAgIRHzAKAgUA5fDHVgIB +# ADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQow +# CAIBAAIDAYagMA0GCSqGSIb3DQEBBQUAA4GBABjrSR17sdYAEtszvl2BWos/C7ZR +# fepANqhK1OqRLv3nelgcpzoYSpF3+csIJ5gGoL5clExMw1t3hkOSQLOzGWvkcWIY +# Tp5Pv4q/CpB/52Mrn1kC2zSej1E9lx0InBB++pTdEr3WCn9KDZsIy8B9M3gtEamp +# Di1hg/Yaskk2pVuQMYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAg +# UENBIDIwMTACEzMAAAGNelUueHSZKrcAAQAAAY0wDQYJYIZIAWUDBAIBBQCgggFK +# MBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgv72G +# 0X2zWUJuJvjSqtgMZ02BVYmEgLTkIUsRp8UHvXIwgfoGCyqGSIb3DQEJEAIvMYHq +# MIHnMIHkMIG9BCCelhEz+h1eQMCfN/a50vnr1bxx8ZODBW56dDy20hjNfzCBmDCB +# gKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQH +# EwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNV +# BAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMCIEIKC8K55Td1F8Kw4pKkbmiSw7Hb/xIcUSNIsHKB52X2hTMA0GCSqG +# SIb3DQEBCwUABIICAMsOXK3vJQX7Jt2lDwVppNTdiboPDVwXRfezsK8NLGK7wZhp +# e/fEsGp3kFdqmeiDT/QGZV+ixnGjOTyJSaq6+wtvZyqKLUoEkhD9g+hFk23Hn3ui +# RiAp6LSf263zzgNQ9SbNssjiOChkILaTpt+GeV+lHAH6N412gYM7pbVyw9v7jvx+ +# Mp+iFKUVQAqZZDGm55MyTqfVdPeb8YpN9pqPSYG4ruCTwZBYGI+p7LFuKgQqF+FB +# 2KTqsTuxoHI6HAV3OibJcIFKQLFxaHjD0/YjYeZSoMUMD/ojZpdEoFrLtTXmIZ2e +# yOFKcX1LMzwwHhEpOpc9m9g4/B2kYTHUl1hFupXEu9PZnNa0IweqtM/GdX/Ji/// +# JRcDe8vtLNQz7z8ZQF28k1ufRDGfm5YIQDHu9Zx33gbpsWIyGZMmlbU4UMJDvAbM +# +sCYtGGLcMEObyiurnDOF4dix7QAdLWqGG2YiyZ9u0T/hRLi3THXhLGK5Xt4dgBk +# aeyJv7T3ZPfsbu8a10lgFkyVbmJt6up2OZbaqW1PjmvgtcsNmRyhD9oSZzOXdTiW +# iIGeLtHEkiSvZnWbaDqpx7ahcaHsmS5QvwWkYGGx1uHMOwJHuFq7jKPo3SYMxAwq +# GQW+QTZroDYL+UTfaUobfPyrS3bDw3L7xVqOOBwGidlOwx3ZYU4mNlSbfCN3 +# SIG # End signature block diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..4e557723dc33 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 @@ -0,0 +1,234 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } + catch { + Write-Warning $_ + } +} +else { + try { + Add-Type -Path ([System.IO.Path]::Combine($PSScriptRoot, "..", "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll")) | Out-Null + $assemblyLoadContextFolder = [System.IO.Path]::Combine($PSScriptRoot, "..", "AzSharedAlcAssemblies") + Write-Debug "Registering Az shared AssemblyLoadContext for path: '$assemblyLoadContextFolder'." + [Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.AzAssemblyLoadContextInitializer]::RegisterAzSharedAssemblyLoadContext($assemblyLoadContextFolder) + Write-Debug "AssemblyLoadContext registered." + } + catch { + Write-Warning $_ + } +} +# SIG # Begin signature block +# MIInrQYJKoZIhvcNAQcCoIInnjCCJ5oCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCfno9x0LEd5gPe +# 4cvAg6ULJtMLR6g+Xis+I4rbSZlHZqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZgjCCGX4CAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgyFkgUqEG +# ohT1KbDw544Hgmj3zWoOXkAlMHIwAyFcowAwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCa0t0uHrS1Z8rXJEETxc2oe78Dv4Qo198ub5+3zLvP +# Uwb+RkVmouToXjo3dapicrrP8ELcphopBonxGcVJFdu9HT8uuwL9KEp0yDpjUxKA +# 0yPVc1pc+f5vmlLY1kyUHMb9Deahzp5oJnL6NLyupJ8w6DLb21SCiIWl71l5vf2B +# i8Nx+jIjxGEC5Emqk6GLFAjR4TR6KO1j6gkHutOu3k0Q/+CgvgEwPbwtBXjcE9jV +# u7AZ6Iu5mE8q7NQ01GwWUMs13xpWLxE8HgvWtu3ozXjFeFaG3u9NEyx/zlkEB1cS +# Ntqh/F34ovkTvJxnIBPSRZfGubCV0fp9Qm0gXxrz3y/roYIXDDCCFwgGCisGAQQB +# gjcDAwExghb4MIIW9AYJKoZIhvcNAQcCoIIW5TCCFuECAQMxDzANBglghkgBZQME +# AgEFADCCAVUGCyqGSIb3DQEJEAEEoIIBRASCAUAwggE8AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIBvIyrpwHucEdb9YUkDCNmUPQk1ErTyZteMy3AB+ +# P++VAgZiL7Y+PNcYEzIwMjIwMzMxMTAwMDA5LjE3NlowBIACAfSggdSkgdEwgc4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1p +# Y3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMg +# VFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt +# U3RhbXAgU2VydmljZaCCEV8wggcQMIIE+KADAgECAhMzAAABpllFgzlNnutLAAEA +# AAGmMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNo +# aW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29y +# cG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEw +# MB4XDTIyMDMwMjE4NTEyMVoXDTIzMDUxMTE4NTEyMVowgc4xCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVy +# YXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJD +# LUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2Vydmlj +# ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANmYv3tSI+fJ/NQJnjz7 +# JvCnc+Xm0rKoe9YKD4MvMYCul7egdrT/zv5vFbQgjNQ74672fNweaztkR65V8y29 +# u5PL2sf01p+uche0Zu4tSig+GsQ6ZQl9tjPRAY/3ITBHDeIYyvq8Wne9+7NoPLhx +# DSO6dtX7YCuQ4zcTP3SE6MvB4b5NighdtvoZVaYk1lXpjUTfdmKoX1ABq1sJbULS +# nSi0Qd4vvl3mZ9jxwv9dR/nlZP62lrZYZq7LPtHD6BlmclB5PT89DnSm1sjaZnFH +# rKzOsmq5GlmL5SFugCCZOoKz133FJeQaFMcXBZSCQjNABWBbHIRCE1ysHHG83Ddo +# nRmnC8EOlYeRwTWz/QCz6q0riOIbYyC/A2BgUEpu9/9EymrTsyMr2/zS8GdEybQ5 +# W7f0WrcrmKB/Y62+g6TmfOS8NtU+L1jGoKNG6Q5RlfJwZu8J/Q9dl4OxyHKuy78+ +# wm6HsF7uAizpsWh63UUaoK/OGQiBG3NJ+kef5eWpnva4ZJfhAnqYTAZD1uHgf8Vf +# Qjnl0BB2YXzK9WaTqde8d+8qCxVKr5hJYvbO+X3+2k5PCirUK/SboreX+xUhVaQE +# hVDYqlatyPttI7Z2IrkhMzwFvc+p0QeyMiNmo2cBZejx8icDOcUidwymDUYqGPE7 +# MA8vtKW3feeSSYJsCEkuUO/vAgMBAAGjggE2MIIBMjAdBgNVHQ4EFgQUOlQhO/zG +# lqK99UkNL/Gu/AryN9gwHwYDVR0jBBgwFoAUn6cVXQBeYl2D9OXSZacbUzUZ6XIw +# XwYDVR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9w +# cy9jcmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3Js +# MGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDovL3d3dy5taWNyb3Nv +# ZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENB +# JTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcD +# CDANBgkqhkiG9w0BAQsFAAOCAgEAgMDxWDTpGqLnFoPhm/iDfwHGF8xr2NbrJl8e +# gEg2ThTJsTf0wBE+ZQsnYfrRmXBbe6sCXLVN70qPuI+OEbN5MOai7Bue1/4j5VTk +# WquH5GZeVat2N+dD7lSUWp0dU8j+uBhBL5GFSmoDVVm+zW2GR2juPI1v254AJTb2 +# l458anlkJjGvmYn2BtRS13h/wDR7hrQaI7BgdyHWAV5+HEj5UhrIrrvtwJiivSaU +# EA3qK6ZK/rZIQv/uORDkONw+2pHHIE1SXm/WIlhrVS2HIogfr3JjqvZion6LJSD7 +# 41j8xVDLiClwAbspHoVFjxtxBcMjqPx6aWCJS8vjSoTnhkV4PO55mqsM7Q8XQRGQ +# hA7w4zNQOJu9kD4xFdYpPUmLN/daIcEElofBjGz+sEd1B4yqqIk3u2G4VygTXFmt +# hL8chSo7r+GIvTqWKhSA/sanS4N3jCgCCe3FTSJsp4g5nwavLvWAtzcOIvSRorGm +# AeN0m2wgzBK95T/qgrGGDXSos1JNDWRVBnP0qsw1Qoq5G0D8hxvQPs3X43KBv1GJ +# l0wo5rcC+9OMWxJlB63gtToQsA1CErYoYLMZtUzJL74jwZk/grpHEQhIhB3sneC8 +# wzGKJuft7YO/HWCpuwdChIjynTnBh+yFGMdg3wRrIbOcw/iKmXZopMTQMOcmIeIw +# JAezA7AwggdxMIIFWaADAgECAhMzAAAAFcXna54Cm0mZAAAAAAAVMA0GCSqGSIb3 +# DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTIw +# MAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgMjAx +# MDAeFw0yMTA5MzAxODIyMjVaFw0zMDA5MzAxODMyMjVaMHwxCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFBDQSAyMDEwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA +# 5OGmTOe0ciELeaLL1yR5vQ7VgtP97pwHB9KpbE51yMo1V/YBf2xK4OK9uT4XYDP/ +# XE/HZveVU3Fa4n5KWv64NmeFRiMMtY0Tz3cywBAY6GB9alKDRLemjkZrBxTzxXb1 +# hlDcwUTIcVxRMTegCjhuje3XD9gmU3w5YQJ6xKr9cmmvHaus9ja+NSZk2pg7uhp7 +# M62AW36MEBydUv626GIl3GoPz130/o5Tz9bshVZN7928jaTjkY+yOSxRnOlwaQ3K +# Ni1wjjHINSi947SHJMPgyY9+tVSP3PoFVZhtaDuaRr3tpK56KTesy+uDRedGbsoy +# 1cCGMFxPLOJiss254o2I5JasAUq7vnGpF1tnYN74kpEeHT39IM9zfUGaRnXNxF80 +# 3RKJ1v2lIH1+/NmeRd+2ci/bfV+AutuqfjbsNkz2K26oElHovwUDo9Fzpk03dJQc +# NIIP8BDyt0cY7afomXw/TNuvXsLz1dhzPUNOwTM5TI4CvEJoLhDqhFFG4tG9ahha +# YQFzymeiXtcodgLiMxhy16cg8ML6EgrXY28MyTZki1ugpoMhXV8wdJGUlNi5UPkL +# iWHzNgY1GIRH29wb0f2y1BzFa/ZcUlFdEtsluq9QBXpsxREdcu+N+VLEhReTwDwV +# 2xo3xwgVGD94q0W29R6HXtqPnhZyacaue7e3PmriLq0CAwEAAaOCAd0wggHZMBIG +# CSsGAQQBgjcVAQQFAgMBAAEwIwYJKwYBBAGCNxUCBBYEFCqnUv5kxJq+gpE8RjUp +# zxD/LwTuMB0GA1UdDgQWBBSfpxVdAF5iXYP05dJlpxtTNRnpcjBcBgNVHSAEVTBT +# MFEGDCsGAQQBgjdMg30BATBBMD8GCCsGAQUFBwIBFjNodHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpb3BzL0RvY3MvUmVwb3NpdG9yeS5odG0wEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYDVR0PBAQDAgGG +# MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAU1fZWy4/oolxiaNE9lJBb186a +# GMQwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3Br +# aS9jcmwvcHJvZHVjdHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3JsMFoGCCsG +# AQUFBwEBBE4wTDBKBggrBgEFBQcwAoY+aHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcnQwDQYJKoZIhvcN +# AQELBQADggIBAJ1VffwqreEsH2cBMSRb4Z5yS/ypb+pcFLY+TkdkeLEGk5c9MTO1 +# OdfCcTY/2mRsfNB1OW27DzHkwo/7bNGhlBgi7ulmZzpTTd2YurYeeNg2LpypglYA +# A7AFvonoaeC6Ce5732pvvinLbtg/SHUB2RjebYIM9W0jVOR4U3UkV7ndn/OOPcbz +# aN9l9qRWqveVtihVJ9AkvUCgvxm2EhIRXT0n4ECWOKz3+SmJw7wXsFSFQrP8DJ6L +# GYnn8AtqgcKBGUIZUnWKNsIdw2FzLixre24/LAl4FOmRsqlb30mjdAy87JGA0j3m +# Sj5mO0+7hvoyGtmW9I/2kQH2zsZ0/fZMcm8Qq3UwxTSwethQ/gpY3UA8x1RtnWN0 +# SCyxTkctwRQEcb9k+SS+c23Kjgm9swFXSVRk2XPXfx5bRAGOWhmRaw2fpCjcZxko +# JLo4S5pu+yFUa2pFEUep8beuyOiJXk+d0tBMdrVXVAmxaQFEfnyhYWxz/gq77EFm +# PWn9y8FBSX5+k77L+DvktxW/tM4+pTFRhLy/AsGConsXHRWJjXD+57XQKBqJC482 +# 2rpM+Zv/Cuk0+CQ1ZyvgDbjmjJnW4SLq8CdCPSWU5nR0W2rRnj7tfqAxM328y+l7 +# vzhwRNGQ8cirOoo6CGJ/2XBjU02N7oJtpQUQwXEGahC0HVUzWLOhcGbyoYIC0jCC +# AjsCAQEwgfyhgdSkgdEwgc4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNv +# MSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UE +# AxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUA +# anQzrZW9TB93Ve7Pa4UPao2ffK2ggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEG +# A1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj +# cm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFt +# cCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXv9TcwIhgPMjAyMjAzMzExMzM5 +# MDNaGA8yMDIyMDQwMTEzMzkwM1owdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e/1 +# NwIBADAKAgEAAgIlMAIB/zAHAgEAAgIRCDAKAgUA5fFGtwIBADA2BgorBgEEAYRZ +# CgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0G +# CSqGSIb3DQEBBQUAA4GBALD1RzDUwq+H9m0MSYjCz5wQ1OtK2kysUfWmpMU4m/5I +# had8kbNZdJ3KIrx0YGBUzNZ+Lq0oh2bND8oZcOvd2Hp24j+V7qoE3si8uVWGudxS +# modF1/mMXXk9ekKyQlZEjz3BMuu37KSyigsrBtFsCP8HOYXKBGcDbc6qn5XH4yKD +# MYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMA +# AAGmWUWDOU2e60sAAQAAAaYwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJ +# AzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgBSF4kR8GItz8rwRGC1l8 +# k8ybbSy8clYGHzCOxkaX3MUwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCCD +# CxmLwz90fWvhMKbJTAQaKt3DoXeiAhfp8TD9tgSrDTCBmDCBgKR+MHwxCzAJBgNV +# BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4w +# HAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29m +# dCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABpllFgzlNnutLAAEAAAGmMCIEIBah +# XRJ2u8MV3DcxWnj3RsKu1063lhZi+mCg8CTJsOXVMA0GCSqGSIb3DQEBCwUABIIC +# AKwjzxsDe/9a9+S3w9P62SVFf6qdfGVu9TFSVozXaesncRAk2r5PYVIzQBLXEctH +# uMjKgizzU+OOxm1sxXQFxUa56d7W+W0Jg7ULtoKBKPQtEUN5uAo4j2bxZGMLqPMd +# DR5oFeKvtuIUk4DiXx02gUT6GITVUnFkkHt4y9j9PwZb7TNlan8/wTeTHO0kH2QZ +# xSt9oLx0jSb5/nBUCAE7G38h6P29oMvljU4xleVaSon0n73QlTg/hMAedxBVDol7 +# ZFh6Q93jDq/8l4XsA4y1UIObDo/8NxDvISc2tYeybT++wrtwkOLw6jpWXezk4uA3 +# cPi5rfOQhiBPG8dLCT9SWelaQWFq6wDL/wWQWWohrMVGaRoIp+p7TrRTUl3eoGIW +# lvUbTuUotQzzmQY1Zf8S4g430lulVYqdenhq6E3mzdU9VjueouAji4yYyJ8jeZmz +# c2e2W3goWOO5UWBujRETmFekpuj1cPiQ1en4QlRDeDHIgUa8OQcFbhof3cXZ0+CM +# mFYy5NofggR5oWN1IO6TAGc5w4tn+6i5RrR+C464W7R39A8peRCPXpZHMX5Nfinl +# McxNzvCRdwxdwMcfAl5fbvKiHAMFVaJlU8YkDHxtshVTBTAdB5scvBwEfVBqTRgN +# Y3evpxNmLhQ49mbUo+IsGdgKb4wU3AOkvXBDIVg0/Ll+ +# SIG # End signature block diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml new file mode 100644 index 000000000000..95d6227f2ef8 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/_rels/.rels b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/_rels/.rels new file mode 100644 index 000000000000..95479a0e6d24 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt new file mode 100644 index 000000000000..7e294d272854 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt @@ -0,0 +1,50 @@ +About topic for Azure PowerShell - about_az + +TOPIC + +about_Az + +SHORT DESCRIPTION + +The Azure Az PowerShell module is a set of cmdlets for managing Azure +resources directly from the PowerShell command line and in PowerShell +scripts. + +LONG DESCRIPTION + +Azure PowerShell provides cross-platform cmdlets for managing Azure +services. All Azure PowerShell cmdlets work on Windows PowerShell 5.1 and +supported versions of PowerShell 7. + +The Azure PowerShell cmdlets follow the naming convention {verb}-Az{noun}. + +- {verb} is an approved PowerShell verb reflecting the corresponding HTTP + operation. + +- {noun} matches or has a close equivalent to the name of the resource. + +The cmdlets produce .NET objects that can be piped between commands +simplifying the sequencing of commands making Azure PowerShell a powerful +solution for scripting and automation purposes. + +A PowerShell module is available for each Azure service. For convenience, +we provide a wrapper module named "Az" that comprises the stable modules. +Modules in preview must be installed independently or via the "AzPreview" +wrapper module. + +Azure PowerShell is frequently updated to include bug fixes and service +updates. It is recommended to plan to update to the most recent version +regularly (a minimum of twice a year). + +GETTING STARTED + +1. Connect to Azure using Connect-AzAccount + +2. Run your first command. For example, create a resource group in the + east US region. + + New-AzResourceGroup -Name "MyResoureGroup" -location "eastus" + +SEE ALSO + +Azure PowerShell documentation: https://docs.microsoft.com/powershell/azure diff --git a/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp new file mode 100644 index 000000000000..5c37526de859 --- /dev/null +++ b/swaggerci/cost-management/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp @@ -0,0 +1,11 @@ + + + Microsoft Corporation + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + Az.Accounts + 2.7.5 + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + NuGet, Version=3.4.4.1321, Culture=neutral, PublicKeyToken=31bf3856ad364e35;Microsoft Windows NT 6.2.9200.0;.NET Framework 4.5 + \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/cost-management/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..522074844f41 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/AsyncCommandRuntime.cs @@ -0,0 +1,832 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + using System.Linq; + + internal interface IAsyncCommandRuntimeExtensions + { + Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep func); + System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs); + + T ExecuteSync(System.Func step); + } + + public class AsyncCommandRuntime : System.Management.Automation.ICommandRuntime2, IAsyncCommandRuntimeExtensions, System.IDisposable + { + private ICommandRuntime2 originalCommandRuntime; + private System.Threading.Thread originalThread; + public bool AllowInteractive { get; set; } = false; + + public CancellationToken cancellationToken; + SemaphoreSlim semaphore = new SemaphoreSlim(1, 1); + ManualResetEventSlim readyToRun = new ManualResetEventSlim(false); + ManualResetEventSlim completed = new ManualResetEventSlim(false); + + System.Action runOnMainThread; + + private System.Management.Automation.PSCmdlet cmdlet; + + internal AsyncCommandRuntime(System.Management.Automation.PSCmdlet cmdlet, CancellationToken cancellationToken) + { + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + this.cancellationToken = cancellationToken; + this.cmdlet = cmdlet; + if (cmdlet.PagingParameters != null) + { + WriteDebug("Client side pagination is enabled for this cmdlet"); + } + cmdlet.CommandRuntime = this; + } + + public PSHost Host => this.originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => this.originalCommandRuntime.CurrentPSTransaction; + + private void CheckForInteractive() + { + // This is an interactive call -- if we are not on the original thread, this will only work if this was done at ACR creation time; + if (!AllowInteractive) + { + throw new System.Exception("AsyncCommandRuntime is not configured for interactive calls"); + } + } + private void WaitOurTurn() + { + // wait for our turn to play + semaphore?.Wait(cancellationToken); + + // ensure that completed is not set + completed.Reset(); + } + + private void WaitForCompletion() + { + // wait for the result (or cancellation!) + WaitHandle.WaitAny(new[] { cancellationToken.WaitHandle, completed?.WaitHandle }); + + // let go of the semaphore + semaphore?.Release(); + + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target, string action) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target, action); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target, action); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out shouldProcessReason); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + ShouldProcessReason reason = ShouldProcessReason.None; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out reason); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + shouldProcessReason = reason; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.ThrowTerminatingError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.ThrowTerminatingError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool TransactionAvailable() + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.TransactionAvailable(); + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.TransactionAvailable(); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteCommandDetail(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteCommandDetail(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteCommandDetail(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteDebug(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteDebug(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteDebug(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteInformation(informationRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteInformation(informationRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(sourceId, progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(sourceId, progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteVerbose(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteVerbose(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteVerbose(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteWarning(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteWarning(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteWarning(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Wait(System.Threading.Tasks.Task ProcessRecordAsyncTask, System.Threading.CancellationToken cancellationToken) + { + do + { + WaitHandle.WaitAny(new[] { readyToRun.WaitHandle, ((System.IAsyncResult)ProcessRecordAsyncTask).AsyncWaitHandle }); + if (readyToRun.IsSet) + { + // reset the request for the next time + readyToRun.Reset(); + + // run the delegate on this thread + runOnMainThread(); + + // tell the originator everything is complete + completed.Set(); + } + } + while (!ProcessRecordAsyncTask.IsCompleted); + if (ProcessRecordAsyncTask.IsFaulted) + { + // don't unwrap a Aggregate Exception -- we'll lose the stack trace of the actual exception. + // if( ProcessRecordAsyncTask.Exception is System.AggregateException aggregate ) { + // throw aggregate.InnerException; + // } + throw ProcessRecordAsyncTask.Exception; + } + } + public Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep func) => func.Target.GetType().Name != "Closure" ? func : (p1, p2, p3) => ExecuteSync>(() => func(p1, p2, p3)); + public System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs) => funcs?.Select(Wrap); + + public T ExecuteSync(System.Func step) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return step(); + } + + T result = default(T); + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + // set the function to run + runOnMainThread = () => { result = step(); }; + // tell the main thread to go ahead + readyToRun.Set(); + // wait for the result (or cancellation!) + WaitForCompletion(); + // return + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Dispose() + { + if (cmdlet != null) + { + cmdlet.CommandRuntime = this.originalCommandRuntime; + cmdlet = null; + } + + semaphore?.Dispose(); + semaphore = null; + readyToRun?.Dispose(); + readyToRun = null; + completed?.Dispose(); + completed = null; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/AsyncJob.cs b/swaggerci/cost-management/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..faaf6ac51545 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/AsyncJob.cs @@ -0,0 +1,270 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + + using System.Threading.Tasks; + + public class LongRunningJobCancelledException : System.Exception + { + public LongRunningJobCancelledException(string message) : base(message) + { + + } + } + + public class AsyncJob : Job, System.Management.Automation.ICommandRuntime2 + { + const int MaxRecords = 1000; + + private string _statusMessage = string.Empty; + + public override string StatusMessage => _statusMessage; + + public override bool HasMoreData => Output.Count > 0 || Progress.Count > 0 || Error.Count > 0 || Warning.Count > 0 || Verbose.Count > 0 || Debug.Count > 0; + + public override string Location => "localhost"; + + public PSHost Host => originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => originalCommandRuntime.CurrentPSTransaction; + + public override void StopJob() + { + Cancel(); + } + + private readonly PSCmdlet cmdlet; + private readonly ICommandRuntime2 originalCommandRuntime; + private readonly System.Threading.Thread originalThread; + + private void CheckForInteractive() + { + // This is an interactive call -- We should never allow interactivity in AsnycJob cmdlets. + throw new System.Exception("Cmdlets in AsyncJob; interactive calls are not permitted."); + } + private bool IsJobDone => CancellationToken.IsCancellationRequested || this.JobStateInfo.State == JobState.Failed || this.JobStateInfo.State == JobState.Stopped || this.JobStateInfo.State == JobState.Stopping || this.JobStateInfo.State == JobState.Completed; + + private readonly System.Action Cancel; + private readonly CancellationToken CancellationToken; + + internal AsyncJob(PSCmdlet cmdlet, string line, string name, CancellationToken cancellationToken, System.Action cancelMethod) : base(line, name) + { + SetJobState(JobState.NotStarted); + // know how to cancel/check for cancelation + this.CancellationToken = cancellationToken; + this.Cancel = cancelMethod; + + // we might need these. + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + + // the instance of the cmdlet we're going to run + this.cmdlet = cmdlet; + + // set the command runtime to the AsyncJob + cmdlet.CommandRuntime = this; + } + + /// + /// Monitors the task (which should be ProcessRecordAsync) to control + /// the lifetime of the job itself + /// + /// + public void Monitor(Task task) + { + SetJobState(JobState.Running); + task.ContinueWith(antecedent => + { + if (antecedent.IsCanceled) + { + // if the task was canceled, we're just going to call it completed. + SetJobState(JobState.Completed); + } + else if (antecedent.IsFaulted) + { + foreach (var innerException in antecedent.Exception.Flatten().InnerExceptions) + { + WriteError(new System.Management.Automation.ErrorRecord(innerException, string.Empty, System.Management.Automation.ErrorCategory.NotSpecified, null)); + } + + // a fault indicates an actual failure + SetJobState(JobState.Failed); + } + else + { + // otherwiser it's a completed state. + SetJobState(JobState.Completed); + } + }, CancellationToken); + } + + private void CheckForCancellation() + { + if (IsJobDone) + { + throw new LongRunningJobCancelledException("Long running job is canceled or stopping, continuation of the cmdlet is not permitted."); + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + CheckForCancellation(); + + this.Information.Add(informationRecord); + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public void WriteDebug(string text) + { + _statusMessage = text; + CheckForCancellation(); + + if (Debug.IsOpen && Debug.Count < MaxRecords) + { + Debug.Add(new DebugRecord(text)); + } + } + + public void WriteError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + + public void WriteObject(object sendToPipeline) + { + CheckForCancellation(); + + if (Output.IsOpen) + { + Output.Add(new PSObject(sendToPipeline)); + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + CheckForCancellation(); + + if (enumerateCollection && sendToPipeline is System.Collections.IEnumerable enumerable) + { + foreach (var item in enumerable) + { + WriteObject(item); + } + } + else + { + WriteObject(sendToPipeline); + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteVerbose(string text) + { + CheckForCancellation(); + + if (Verbose.IsOpen && Verbose.Count < MaxRecords) + { + Verbose.Add(new VerboseRecord(text)); + } + } + + public void WriteWarning(string text) + { + CheckForCancellation(); + + if (Warning.IsOpen && Warning.Count < MaxRecords) + { + Warning.Add(new WarningRecord(text)); + } + } + + public void WriteCommandDetail(string text) + { + WriteVerbose(text); + } + + public bool ShouldProcess(string target) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string target, string action) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + CheckForInteractive(); + shouldProcessReason = ShouldProcessReason.None; + return false; + } + + public bool ShouldContinue(string query, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public bool TransactionAvailable() + { + // interactivity required? + return false; + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/AsyncOperationResponse.cs b/swaggerci/cost-management/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..90ed70f2a505 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/AsyncOperationResponse.cs @@ -0,0 +1,176 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.PowerShell +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + [System.ComponentModel.TypeConverter(typeof(AsyncOperationResponseTypeConverter))] + public class AsyncOperationResponse + { + private string _target; + public string Target { get => _target; set => _target = value; } + public AsyncOperationResponse() + { + } + internal AsyncOperationResponse(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json) + { + // pull target + { Target = If(json?.PropertyT("target"), out var _v) ? (string)_v : (string)Target; } + } + public string ToJsonString() + { + return $"{{ \"target\" : \"{this.Target}\" }}"; + } + + public static AsyncOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject json ? new AsyncOperationResponse(json) : null; + } + + + /// + /// 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 AsyncOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(jsonText)); + + } + + public partial class AsyncOperationResponseTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to a type + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static object ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(AsyncOperationResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AsyncOperationResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()); ; + } + catch + { + // Unable to use JSON pattern + } + + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as System.Management.Automation.PSObject).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as global::System.Collections.IDictionary).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + return null; + } + + /// 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/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..544bb94091ad --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs @@ -0,0 +1,113 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "CmdletSurface")] + [DoNotExport] + public class ExportCmdletSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CmdletFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool IncludeGeneralParameters { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetScriptCmdlets(this, CmdletFolder) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + foreach (var profileGroup in profileGroups) + { + var variantGroups = profileGroup.Variants + .GroupBy(v => new { v.CmdletName }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), String.Empty, profileGroup.ProfileName)); + var sb = UseExpandedFormat ? ExpandedFormat(variantGroups) : CondensedFormat(variantGroups); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, $"CmdletSurface-{profileGroup.ProfileName}.md"), sb.ToString()); + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private StringBuilder ExpandedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + foreach (var variantGroup in variantGroups.OrderBy(vg => vg.CmdletName)) + { + sb.Append($"### {variantGroup.CmdletName}{Environment.NewLine}"); + var parameterGroups = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private StringBuilder CondensedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + var condensedGroups = variantGroups + .GroupBy(vg => vg.CmdletNoun) + .Select(vgg => ( + CmdletNoun: vgg.Key, + CmdletVerbs: vgg.Select(vg => vg.CmdletVerb).OrderBy(cv => cv).ToArray(), + ParameterGroups: vgg.SelectMany(vg => vg.ParameterGroups).DistinctBy(p => p.ParameterName).ToArray(), + OutputTypes: vgg.SelectMany(vg => vg.OutputTypes).Select(ot => ot.Type).DistinctBy(t => t.Name).Select(t => t.ToSyntaxTypeName()).ToArray())) + .OrderBy(vg => vg.CmdletNoun); + foreach (var condensedGroup in condensedGroups) + { + sb.Append($"### {condensedGroup.CmdletNoun} [{String.Join(", ", condensedGroup.CmdletVerbs)}] `{String.Join(", ", condensedGroup.OutputTypes)}`{Environment.NewLine}"); + var parameterGroups = condensedGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..ee742f8cd848 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * 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.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ExampleStub")] + [DoNotExport] + public class ExportExampleStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + protected override void ProcessRecord() + { + 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 exampleText = String.Join(String.Empty, DefaultExampleHelpInfos.Select(ehi => ehi.ToHelpExampleOutput())); + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var cmdletFilePaths = GetScriptCmdlets(exportDirectory).Select(fi => Path.Combine(outputFolder, $"{fi.Name}.md")).ToArray(); + var currentExamplesFilePaths = Directory.GetFiles(outputFolder).ToArray(); + // Remove examples of non-existing cmdlets + var removedCmdletFilePaths = currentExamplesFilePaths.Except(cmdletFilePaths); + foreach (var removedCmdletFilePath in removedCmdletFilePaths) + { + File.Delete(removedCmdletFilePath); + } + + // Only create example stubs if they don't exist + foreach (var cmdletFilePath in cmdletFilePaths.Except(currentExamplesFilePaths)) + { + File.WriteAllText(cmdletFilePath, exampleText); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..daf59245d124 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -0,0 +1,101 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "FormatPs1xml")] + [DoNotExport] + public class ExportFormatPs1xml : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FilePath { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Cost.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Cost.Support"; + private const string PropertiesExcludedForTableview = @""; + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + + protected override void ProcessRecord() + { + try + { + var viewModels = GetFilteredViewParameters().Select(CreateViewModel).ToList(); + var ps1xml = new Configuration + { + ViewDefinitions = new ViewDefinitions + { + Views = viewModels + } + }; + File.WriteAllText(FilePath, ps1xml.ToXmlString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static IEnumerable GetFilteredViewParameters() + { + //https://stackoverflow.com/a/79738/294804 + //https://stackoverflow.com/a/949285/294804 + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass + && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace)) + && !t.GetCustomAttributes().Any()); + return types.Select(t => new ViewParameters(t, t.GetProperties() + .Select(p => new PropertyFormat(p)) + .Where(pf => !pf.Property.GetCustomAttributes().Any() + && (!PropertiesExcludedForTableview.Split(',').Contains(pf.Property.Name)) + && (pf.FormatTable != null || (pf.Origin != PropertyOrigin.Inlined && pf.Property.PropertyType.IsPsSimple()))) + .OrderByDescending(pf => pf.Index.HasValue) + .ThenBy(pf => pf.Index) + .ThenByDescending(pf => pf.Origin.HasValue) + .ThenBy(pf => pf.Origin))).Where(vp => vp.Properties.Any()); + } + + private static View CreateViewModel(ViewParameters viewParameters) + { + var entries = viewParameters.Properties.Select(pf => + (TableColumnHeader: new TableColumnHeader { Label = pf.Label, Width = pf.Width }, + TableColumnItem: new TableColumnItem { PropertyName = pf.Property.Name })).ToArray(); + + return new View + { + Name = viewParameters.Type.FullName, + ViewSelectedBy = new ViewSelectedBy + { + TypeName = viewParameters.Type.FullName + }, + TableControl = new TableControl + { + TableHeaders = new TableHeaders + { + TableColumnHeaders = entries.Select(e => e.TableColumnHeader).ToList() + }, + TableRowEntries = new TableRowEntries + { + TableRowEntry = new TableRowEntry + { + TableColumnItems = new TableColumnItems + { + TableItems = entries.Select(e => e.TableColumnItem).ToList() + } + } + } + } + }; + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..037c18ec5712 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.MarkdownRenderer; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "HelpMarkdown")] + [DoNotExport] + public class ExportHelpMarkdown : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSModuleInfo ModuleInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] FunctionInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] HelpInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + var helpInfos = HelpInfo.Select(hi => hi.ToPsHelpInfo()); + var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() + .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) + .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..5219c02ca5cc --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ModelSurface")] + [DoNotExport] + public class ExportModelSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Cost.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Cost.Support"; + + protected override void ProcessRecord() + { + try + { + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace))); + var typeInfos = types.Select(t => new ModelTypeInfo + { + Type = t, + TypeName = t.Name, + Properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => !p.GetIndexParameters().Any()).OrderBy(p => p.Name).ToArray(), + NamespaceGroup = t.Namespace.Split('.').LastOrDefault().EmptyIfNull() + }).Where(mti => mti.Properties.Any()); + var sb = UseExpandedFormat ? ExpandedFormat(typeInfos) : CondensedFormat(typeInfos); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, "ModelSurface.md"), sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static StringBuilder ExpandedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + foreach (var typeInfo in typeInfos.OrderBy(mti => mti.TypeName).ThenBy(mti => mti.NamespaceGroup)) + { + sb.Append($"### {typeInfo.TypeName} [{typeInfo.NamespaceGroup}]{Environment.NewLine}"); + foreach (var property in typeInfo.Properties) + { + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private static StringBuilder CondensedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + var typeGroups = typeInfos + .GroupBy(mti => mti.TypeName) + .Select(tig => ( + Types: tig.Select(mti => mti.Type).ToArray(), + TypeName: tig.Key, + Properties: tig.SelectMany(mti => mti.Properties).DistinctBy(p => p.Name).OrderBy(p => p.Name).ToArray(), + NamespaceGroups: tig.Select(mti => mti.NamespaceGroup).OrderBy(ng => ng).ToArray() + )) + .OrderBy(tg => tg.TypeName); + foreach (var typeGroup in typeGroups) + { + var aType = typeGroup.Types.Select(GetAssociativeType).FirstOrDefault(t => t != null); + var aText = aType != null ? $@" \<{aType.ToSyntaxTypeName()}\>" : String.Empty; + sb.Append($"### {typeGroup.TypeName}{aText} [{String.Join(", ", typeGroup.NamespaceGroups)}]{Environment.NewLine}"); + foreach (var property in typeGroup.Properties) + { + var propertyAType = GetAssociativeType(property.PropertyType); + var propertyAText = propertyAType != null ? $" <{propertyAType.ToSyntaxTypeName()}>" : String.Empty; + var enumNames = GetEnumFieldNames(property.PropertyType.Unwrap()); + var enumNamesText = enumNames.Any() ? $" **{{{String.Join(", ", enumNames)}}}**" : String.Empty; + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}{propertyAText}`{enumNamesText}{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + //https://stackoverflow.com/a/4963190/294804 + private static Type GetAssociativeType(Type type) => + type.GetInterfaces().FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>))?.GetGenericArguments().First(); + + private static string[] GetEnumFieldNames(Type type) => + type.IsValueType && !type.IsPrimitive && type != typeof(decimal) && type != typeof(DateTime) + ? type.GetFields(BindingFlags.Public | BindingFlags.Static).Where(f => f.FieldType == type).Select(p => p.Name).ToArray() + : new string[] { }; + + private class ModelTypeInfo + { + public Type Type { get; set; } + public string TypeName { get; set; } + public PropertyInfo[] Properties { get; set; } + public string NamespaceGroup { get; set; } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..19109872565a --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * 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.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsHelpers; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.MarkdownRenderer; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsProxyTypeExtensions; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ProxyCmdlet", DefaultParameterSetName = "Docs")] + [DoNotExport] + public class ExportProxyCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string[] ModulePath { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string InternalFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [AllowEmptyString] + public string ModuleDescription { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + public Guid ModuleGuid { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] + public SwitchParameter ExcludeDocs { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetModuleCmdletsAndHelpInfo(this, ModulePath).SelectMany(ci => ci.ToVariants()).Where(v => !v.IsDoNotExport).ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + 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))) + .ToArray(); + + var license = new StringBuilder(); + license.Append(@" +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +"); + HashSet LicenseSet = new HashSet(); + foreach (var variantGroup in variantGroups) + { + var parameterGroups = variantGroup.ParameterGroups.ToList(); + var isValidProfile = !String.IsNullOrEmpty(variantGroup.ProfileName) && variantGroup.ProfileName != NoProfiles; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, variantGroup.ProfileName) : ExamplesFolder; + var markdownInfo = new MarkdownHelpInfo(variantGroup, examplesFolder); + List examples = new List(); + foreach (var it in markdownInfo.Examples) + { + examples.Add(it); + } + variantGroup.HelpInfo.Examples = examples.ToArray(); + var sb = new StringBuilder(); + sb.Append($"{Environment.NewLine}"); + sb.Append(variantGroup.ToHelpCommentOutput()); + sb.Append($"function {variantGroup.CmdletName} {{{Environment.NewLine}"); + sb.Append(variantGroup.Aliases.ToAliasOutput()); + sb.Append(variantGroup.OutputTypes.ToOutputTypeOutput()); + sb.Append(variantGroup.ToCmdletBindingOutput()); + sb.Append(variantGroup.ProfileName.ToProfileOutput()); + + 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; + parameters = parameters.Where(p => !p.IsHidden()); + if (!parameters.Any()) + { + continue; + } + foreach (var parameter in parameters) + { + sb.Append(parameter.ToParameterOutput(variantGroup.HasMultipleVariants, parameterGroup.HasAllVariants)); + } + sb.Append(parameterGroup.Aliases.ToAliasOutput(true)); + sb.Append(parameterGroup.HasValidateNotNull.ToValidateNotNullOutput()); + sb.Append(parameterGroup.HasAllowEmptyArray.ToAllowEmptyArray()); + sb.Append(parameterGroup.CompleterInfo.ToArgumentCompleterOutput()); + sb.Append(parameterGroup.OrderCategory.ToParameterCategoryOutput()); + sb.Append(parameterGroup.InfoAttribute.ToInfoOutput(parameterGroup.ParameterType)); + sb.Append(parameterGroup.ToDefaultInfoOutput()); + sb.Append(parameterGroup.ParameterType.ToParameterTypeOutput()); + sb.Append(parameterGroup.Description.ToParameterDescriptionOutput()); + sb.Append(parameterGroup.ParameterName.ToParameterNameOutput(parameterGroups.IndexOf(parameterGroup) == parameterGroups.Count - 1)); + } + sb.Append($"){Environment.NewLine}{Environment.NewLine}"); + + sb.Append(variantGroup.ToBeginOutput()); + sb.Append(variantGroup.ToProcessOutput()); + sb.Append(variantGroup.ToEndOutput()); + + sb.Append($"}}{Environment.NewLine}"); + + Directory.CreateDirectory(variantGroup.OutputFolder); + File.WriteAllText(variantGroup.FilePath, license.ToString()); + File.AppendAllText(variantGroup.FilePath, sb.ToString()); + if (!LicenseSet.Contains(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"))) + { + // only add license in the header + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), license.ToString()); + LicenseSet.Add(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1")); + } + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), sb.ToString()); + } + + if (!ExcludeDocs) + { + var moduleInfo = new PsModuleHelpInfo(ModuleName, ModuleGuid, ModuleDescription); + foreach (var variantGroupsByProfile in variantGroups.GroupBy(vg => vg.ProfileName)) + { + var profileName = variantGroupsByProfile.Key; + var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; + var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..074d22e7aac6 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -0,0 +1,191 @@ +/*--------------------------------------------------------------------------------------------- + * 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.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "Psd1")] + [DoNotExport] + public class ExportPsd1 : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CustomFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + [Parameter(Mandatory = true)] + public Guid ModuleGuid { get; set; } + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private const string CustomFolderRelative = "./custom"; + private const string Indent = Psd1Indent; + private const string Undefined = "undefined"; + private bool IsUndefined(string value) => string.Equals(Undefined, value, StringComparison.OrdinalIgnoreCase); + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + if (!Directory.Exists(CustomFolder)) + { + throw new ArgumentException($"Custom folder '{CustomFolder}' does not exist"); + } + + string version = Convert.ToString(@"0.1.0"); + // Validate the module version should be semantic version + // Following regex is official from https://semver.org/ + Regex rx = new Regex(@"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", RegexOptions.Compiled); + if (rx.Matches(version).Count != 1) + { + throw new ArgumentException("Module-version is not a valid Semantic Version"); + } + + string previewVersion = null; + if (version.Contains('-')) + { + string[] versions = version.Split("-".ToCharArray(), 2); + version = versions[0]; + previewVersion = versions[1]; + } + + var sb = new StringBuilder(); + sb.AppendLine("@{"); + sb.AppendLine($@"{GuidStart} = '{ModuleGuid}'"); + sb.AppendLine($@"{Indent}RootModule = '{"./Az.Cost.psm1"}'"); + sb.AppendLine($@"{Indent}ModuleVersion = '{version}'"); + sb.AppendLine($@"{Indent}CompatiblePSEditions = 'Core', 'Desktop'"); + sb.AppendLine($@"{Indent}Author = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}CompanyName = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}Copyright = '{"Microsoft Corporation. All rights reserved."}'"); + sb.AppendLine($@"{Indent}Description = '{"Microsoft Azure PowerShell: Cost cmdlets"}'"); + sb.AppendLine($@"{Indent}PowerShellVersion = '5.1'"); + sb.AppendLine($@"{Indent}DotNetFrameworkVersion = '4.7.2'"); + + // RequiredModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredModules = @({"undefined"})"); + } + + // RequiredAssemblies + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredAssemblies = @({"undefined"})"); + } + else + { + sb.AppendLine($@"{Indent}RequiredAssemblies = '{"./bin/Az.Cost.private.dll"}'"); + } + + // NestedModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}NestedModules = @({"undefined"})"); + } + + // FormatsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FormatsToProcess = @({"undefined"})"); + } + else + { + var customFormatPs1xmlFiles = Directory.GetFiles(CustomFolder) + .Where(f => f.EndsWith(".format.ps1xml")) + .Select(f => $"{CustomFolderRelative}/{Path.GetFileName(f)}"); + var formatList = customFormatPs1xmlFiles.Prepend("./Az.Cost.format.ps1xml").ToPsList(); + sb.AppendLine($@"{Indent}FormatsToProcess = {formatList}"); + } + + // TypesToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}TypesToProcess = @({"undefined"})"); + } + + // ScriptsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}ScriptsToProcess = @({"undefined"})"); + } + + var functionInfos = GetScriptCmdlets(ExportsFolder).ToArray(); + // FunctionsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FunctionsToExport = @({"undefined"})"); + } + else + { + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); + } + + // AliasesToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}AliasesToExport = @({"undefined"})"); + } + else + { + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } + + // CmdletsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}CmdletsToExport = @({"undefined"})"); + } + + sb.AppendLine($@"{Indent}PrivateData = @{{"); + sb.AppendLine($@"{Indent}{Indent}PSData = @{{"); + + if (previewVersion != null) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = '{previewVersion}'"); + } + sb.AppendLine($@"{Indent}{Indent}{Indent}Tags = {"Azure ResourceManager ARM PSModule Cost".Split(' ').ToPsList().NullIfEmpty() ?? "''"}"); + sb.AppendLine($@"{Indent}{Indent}{Indent}LicenseUri = '{"https://aka.ms/azps-license"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ProjectUri = '{"https://github.com/Azure/azure-powershell"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ReleaseNotes = ''"); + var profilesList = ""; + if (IsAzure && !String.IsNullOrEmpty(profilesList)) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Profiles = {profilesList}"); + } + + sb.AppendLine($@"{Indent}{Indent}}}"); + sb.AppendLine($@"{Indent}}}"); + sb.AppendLine(@"}"); + + File.WriteAllText(Psd1Path, sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..a3f3c38c414c --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -0,0 +1,148 @@ +/*--------------------------------------------------------------------------------------------- + * 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.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.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() + { + 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 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]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +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(@"{ + $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 + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} +"); + + + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); + + 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) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..3d877cc0f72e --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "CommonParameter")] + [OutputType(typeof(Dictionary))] + [DoNotExport] + public class GetCommonParameter : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSCmdlet PSCmdlet { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public Dictionary PSBoundParameter { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = PSCmdlet.MyInvocation.MyCommand.ToVariants(); + var commonParameterNames = variants.ToParameterGroups() + .Where(pg => pg.OrderCategory == ParameterCategory.Azure || pg.OrderCategory == ParameterCategory.Runtime) + .Select(pg => pg.ParameterName); + if (variants.Any(v => v.SupportsShouldProcess)) + { + commonParameterNames = commonParameterNames.Append("Confirm").Append("WhatIf"); + } + if (variants.Any(v => v.SupportsPaging)) + { + commonParameterNames = commonParameterNames.Append("First").Append("Skip").Append("IncludeTotalCount"); + } + + var names = commonParameterNames.ToArray(); + var keys = PSBoundParameter.Keys.Where(k => names.Contains(k)); + WriteObject(keys.ToDictionary(key => key, key => PSBoundParameter[key]), true); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..22cdcae3cc49 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ModuleGuid")] + [DoNotExport] + public class GetModuleGuid : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + protected override void ProcessRecord() + { + try + { + WriteObject(ReadGuidFromPsd1(Psd1Path)); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..4fd3fe1428ce --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ScriptCmdlet")] + [OutputType(typeof(string[]))] + [DoNotExport] + public class GetScriptCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ScriptFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeDoNotExport { get; set; } + + [Parameter] + public SwitchParameter AsAlias { get; set; } + + [Parameter] + public SwitchParameter AsFunctionInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var functionInfos = GetScriptCmdlets(this, ScriptFolder) + .Where(fi => IncludeDoNotExport || !fi.ScriptBlock.Attributes.OfType().Any()) + .ToArray(); + if (AsFunctionInfo) + { + WriteObject(functionInfos, true); + return; + } + var aliases = functionInfos.SelectMany(i => i.ScriptBlock.Attributes).ToAliasNames(); + var names = functionInfos.Select(fi => fi.Name).Distinct(); + var output = (AsAlias ? aliases : names).DefaultIfEmpty("''").ToArray(); + WriteObject(output, true); + } + catch (System.Exception ee) + { + System.Console.Error.WriteLine($"{ee.GetType().Name}: {ee.Message}"); + System.Console.Error.WriteLine(ee.StackTrace); + throw ee; + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/cost-management/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..4e562ab725cf --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/CollectionExtensions.cs @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal static class CollectionExtensions + { + public static T[] NullIfEmpty(this T[] collection) => (collection?.Any() ?? false) ? collection : null; + public static IEnumerable EmptyIfNull(this IEnumerable collection) => collection ?? Enumerable.Empty(); + + // https://stackoverflow.com/a/4158364/294804 + public static IEnumerable DistinctBy(this IEnumerable collection, Func selector) => + collection.GroupBy(selector).Select(group => group.First()); + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/cost-management/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..463559f64ea4 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.IO; +using System.Linq; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsProxyOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal static class MarkdownRenderer + { + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder) + { + Directory.CreateDirectory(docsFolder); + var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); + + foreach (var markdownInfo in markdownInfos) + { + var sb = new StringBuilder(); + sb.Append(markdownInfo.ToHelpMetadataOutput()); + sb.Append($"# {markdownInfo.CmdletName}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"## SYNOPSIS{Environment.NewLine}{markdownInfo.Synopsis.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## SYNTAX{Environment.NewLine}{Environment.NewLine}"); + var hasMultipleParameterSets = markdownInfo.SyntaxInfos.Length > 1; + foreach (var syntaxInfo in markdownInfo.SyntaxInfos) + { + sb.Append(syntaxInfo.ToHelpSyntaxOutput(hasMultipleParameterSets)); + } + + sb.Append($"## DESCRIPTION{Environment.NewLine}{markdownInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## EXAMPLES{Environment.NewLine}{Environment.NewLine}"); + foreach (var exampleInfo in markdownInfo.Examples) + { + sb.Append(exampleInfo.ToHelpExampleOutput()); + } + + sb.Append($"## PARAMETERS{Environment.NewLine}{Environment.NewLine}"); + foreach (var parameter in markdownInfo.Parameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + if (markdownInfo.SupportsShouldProcess) + { + foreach (var parameter in SupportsShouldProcessParameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + } + + sb.Append($"### CommonParameters{Environment.NewLine}This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## INPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var input in markdownInfo.Inputs) + { + sb.Append($"### {input}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## OUTPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var output in markdownInfo.Outputs) + { + sb.Append($"### {output}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); + foreach (var alias in markdownInfo.Aliases) + { + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + } + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); + foreach (var relatedLink in markdownInfo.RelatedLinks) + { + sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); + } + + WriteModulePage(moduleHelpInfo, markdownInfos, docsFolder); + } + + private static void WriteModulePage(PsModuleHelpInfo moduleInfo, MarkdownHelpInfo[] markdownInfos, string docsFolder) + { + var sb = new StringBuilder(); + sb.Append(moduleInfo.ToModulePageMetadataOutput()); + sb.Append($"# {moduleInfo.Name} Module{Environment.NewLine}"); + sb.Append($"## Description{Environment.NewLine}{moduleInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## {moduleInfo.Name} Cmdlets{Environment.NewLine}"); + foreach (var markdownInfo in markdownInfos) + { + sb.Append(markdownInfo.ToModulePageCmdletOutput()); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{moduleInfo.Name}.md"), sb.ToString()); + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..3c3f95460159 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsFormatTypes.cs @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Linq; +using System.Reflection; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal class ViewParameters + { + public Type Type { get; } + public IEnumerable Properties { get; } + + public ViewParameters(Type type, IEnumerable properties) + { + Type = type; + Properties = properties; + } + } + + internal class PropertyFormat + { + public PropertyInfo Property { get; } + public FormatTableAttribute FormatTable { get; } + + public int? Index { get; } + public string Label { get; } + public int? Width { get; } + public PropertyOrigin? Origin { get; } + + public PropertyFormat(PropertyInfo propertyInfo) + { + Property = propertyInfo; + FormatTable = Property.GetCustomAttributes().FirstOrDefault(); + var origin = Property.GetCustomAttributes().FirstOrDefault(); + + Index = FormatTable?.HasIndex ?? false ? (int?)FormatTable.Index : null; + Label = FormatTable?.Label ?? propertyInfo.Name; + Width = FormatTable?.HasWidth ?? false ? (int?)FormatTable.Width : null; + // If we have an index, we don't want to use Origin. + Origin = FormatTable?.HasIndex ?? false ? null : origin?.Origin; + } + } + + [Serializable] + [XmlRoot(nameof(Configuration))] + public class Configuration + { + [XmlElement("ViewDefinitions")] + public ViewDefinitions ViewDefinitions { get; set; } + } + + [Serializable] + public class ViewDefinitions + { + //https://stackoverflow.com/a/10518657/294804 + [XmlElement("View")] + public List Views { get; set; } + } + + [Serializable] + public class View + { + [XmlElement(nameof(Name))] + public string Name { get; set; } + [XmlElement(nameof(ViewSelectedBy))] + public ViewSelectedBy ViewSelectedBy { get; set; } + [XmlElement(nameof(TableControl))] + public TableControl TableControl { get; set; } + } + + [Serializable] + public class ViewSelectedBy + { + [XmlElement(nameof(TypeName))] + public string TypeName { get; set; } + } + + [Serializable] + public class TableControl + { + [XmlElement(nameof(TableHeaders))] + public TableHeaders TableHeaders { get; set; } + [XmlElement(nameof(TableRowEntries))] + public TableRowEntries TableRowEntries { get; set; } + } + + [Serializable] + public class TableHeaders + { + [XmlElement("TableColumnHeader")] + public List TableColumnHeaders { get; set; } + } + + [Serializable] + public class TableColumnHeader + { + [XmlElement(nameof(Label))] + public string Label { get; set; } + [XmlElement(nameof(Width))] + public int? Width { get; set; } + + //https://stackoverflow.com/a/4095225/294804 + public bool ShouldSerializeWidth() => Width.HasValue; + } + + [Serializable] + public class TableRowEntries + { + [XmlElement(nameof(TableRowEntry))] + public TableRowEntry TableRowEntry { get; set; } + } + + [Serializable] + public class TableRowEntry + { + [XmlElement(nameof(TableColumnItems))] + public TableColumnItems TableColumnItems { get; set; } + } + + [Serializable] + public class TableColumnItems + { + [XmlElement("TableColumnItem")] + public List TableItems { get; set; } + } + + [Serializable] + public class TableColumnItem + { + [XmlElement(nameof(PropertyName))] + public string PropertyName { get; set; } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..26b1d79fb3f8 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs @@ -0,0 +1,199 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal class HelpMetadataOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public HelpMetadataOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"--- +external help file:{(!String.IsNullOrEmpty(HelpInfo.ExternalHelpFilename) ? $" {HelpInfo.ExternalHelpFilename}" : String.Empty)} +Module Name: {HelpInfo.ModuleName} +online version: {HelpInfo.OnlineVersion} +schema: {HelpInfo.Schema.ToString(3)} +--- + +"; + } + + internal class HelpSyntaxOutput + { + public MarkdownSyntaxHelpInfo SyntaxInfo { get; } + public bool HasMultipleParameterSets { get; } + + public HelpSyntaxOutput(MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) + { + SyntaxInfo = syntaxInfo; + HasMultipleParameterSets = hasMultipleParameterSets; + } + + public override string ToString() + { + var psnText = HasMultipleParameterSets ? $"### {SyntaxInfo.ParameterSetName}{(SyntaxInfo.IsDefault ? " (Default)" : String.Empty)}{Environment.NewLine}" : String.Empty; + return $@"{psnText}``` +{SyntaxInfo.SyntaxText} +``` + +"; + } + } + + internal class HelpExampleOutput + { + private string ExampleTemplate = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + Environment.NewLine; + + private string ExampleTemplateWithOutput = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine + + "{8}" + Environment.NewLine + Environment.NewLine; + + public MarkdownExampleHelpInfo ExampleInfo { get; } + + public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) + { + ExampleInfo = exampleInfo; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(ExampleInfo.Output)) + { + return string.Format(ExampleTemplate, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleInfo.Description.ToDescriptionFormat()); + } + else + { + return string.Format(ExampleTemplateWithOutput, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter, + ExampleInfo.Description.ToDescriptionFormat()); ; + } + } + } + + internal class HelpParameterOutput + { + public MarkdownParameterHelpInfo ParameterInfo { get; } + + public HelpParameterOutput(MarkdownParameterHelpInfo parameterInfo) + { + ParameterInfo = parameterInfo; + } + + public override string ToString() + { + var pipelineInputTypes = new[] + { + ParameterInfo.AcceptsPipelineByValue ? "ByValue" : String.Empty, + ParameterInfo.AcceptsPipelineByPropertyName ? "ByPropertyName" : String.Empty + }.JoinIgnoreEmpty(", "); + var pipelineInput = ParameterInfo.AcceptsPipelineByValue || ParameterInfo.AcceptsPipelineByPropertyName + ? $@"{true} ({pipelineInputTypes})" + : false.ToString(); + + return $@"### -{ParameterInfo.Name} +{ParameterInfo.Description.ToDescriptionFormat()} + +```yaml +Type: {ParameterInfo.Type.FullName} +Parameter Sets: {(ParameterInfo.HasAllParameterSets ? "(All)" : ParameterInfo.ParameterSetNames.JoinIgnoreEmpty(", "))} +Aliases:{(ParameterInfo.Aliases.Any() ? $" {ParameterInfo.Aliases.JoinIgnoreEmpty(", ")}" : String.Empty)} + +Required: {ParameterInfo.IsRequired} +Position: {ParameterInfo.Position} +Default value: {ParameterInfo.DefaultValue} +Accept pipeline input: {pipelineInput} +Accept wildcard characters: {ParameterInfo.AcceptsWildcardCharacters} +``` + +"; + } + } + + internal class ModulePageMetadataOutput + { + public PsModuleHelpInfo ModuleInfo { get; } + + private static string HelpLinkPrefix { get; } = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public ModulePageMetadataOutput(PsModuleHelpInfo moduleInfo) + { + ModuleInfo = moduleInfo; + } + + public override string ToString() => $@"--- +Module Name: {ModuleInfo.Name} +Module Guid: {ModuleInfo.Guid} +Download Help Link: {HelpLinkPrefix}{ModuleInfo.Name.ToLowerInvariant()} +Help Version: 1.0.0.0 +Locale: en-US +--- + +"; + } + + internal class ModulePageCmdletOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public ModulePageCmdletOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"### [{HelpInfo.CmdletName}]({HelpInfo.CmdletName}.md) +{HelpInfo.Synopsis.ToDescriptionFormat()} + +"; + } + + internal static class PsHelpOutputExtensions + { + public static string EscapeAngleBrackets(this string text) => text?.Replace("<", @"\<").Replace(">", @"\>"); + public static string ReplaceSentenceEndWithNewline(this string text) => text?.Replace(". ", $".{Environment.NewLine}").Replace(". ", $".{Environment.NewLine}"); + public static string ReplaceBrWithNewline(this string text) => text?.Replace("
", $"{Environment.NewLine}"); + public static string ToDescriptionFormat(this string text, bool escapeAngleBrackets = true) + { + var description = text?.ReplaceBrWithNewline(); + description = escapeAngleBrackets ? description?.EscapeAngleBrackets() : description; + return description?.ReplaceSentenceEndWithNewline().Trim(); + } + + public const string ExampleNameHeader = "### "; + public const string ExampleCodeHeader = "```powershell"; + public const string ExampleCodeFooter = "```"; + public const string ExampleOutputHeader = "```output"; + public const string ExampleOutputFooter = "```"; + + public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo); + + public static HelpSyntaxOutput ToHelpSyntaxOutput(this MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) => new HelpSyntaxOutput(syntaxInfo, hasMultipleParameterSets); + + public static HelpExampleOutput ToHelpExampleOutput(this MarkdownExampleHelpInfo exampleInfo) => new HelpExampleOutput(exampleInfo); + + public static HelpParameterOutput ToHelpParameterOutput(this MarkdownParameterHelpInfo parameterInfo) => new HelpParameterOutput(parameterInfo); + + public static ModulePageMetadataOutput ToModulePageMetadataOutput(this PsModuleHelpInfo moduleInfo) => new ModulePageMetadataOutput(moduleInfo); + + public static ModulePageCmdletOutput ToModulePageCmdletOutput(this MarkdownHelpInfo helpInfo) => new ModulePageCmdletOutput(helpInfo); + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..5a76052abc20 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -0,0 +1,202 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal class PsHelpInfo + { + public string CmdletName { get; } + public string ModuleName { get; } + public string Synopsis { get; } + public string Description { get; } + public string AlertText { get; } + public string Category { get; } + public PsHelpLinkInfo OnlineVersion { get; } + public PsHelpLinkInfo[] RelatedLinks { get; } + public bool? HasCommonParameters { get; } + public bool? HasWorkflowCommonParameters { get; } + + public PsHelpTypeInfo[] InputTypes { get; } + public PsHelpTypeInfo[] OutputTypes { get; } + public PsHelpExampleInfo[] Examples { get; set; } + public string[] Aliases { get; } + + public PsParameterHelpInfo[] Parameters { get; } + public PsHelpSyntaxInfo[] Syntax { get; } + + public object Component { get; } + public object Functionality { get; } + public object PsSnapIn { get; } + public object Role { get; } + public string NonTerminatingErrors { get; } + + public PsHelpInfo(PSObject helpObject = null) + { + helpObject = helpObject ?? new PSObject(); + CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); + ModuleName = helpObject.GetProperty("ModuleName"); + Synopsis = helpObject.GetProperty("Synopsis"); + Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? + helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); + Category = helpObject.GetProperty("Category"); + HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); + HasWorkflowCommonParameters = helpObject.GetProperty("WorkflowCommonParameters").ToNullableBool(); + + var links = helpObject.GetNestedProperty("relatedLinks", "navigationLink").EmptyIfNull().Select(nl => nl.ToLinkInfo()).ToArray(); + OnlineVersion = links.FirstOrDefault(l => l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length == 1); + RelatedLinks = links.Where(l => !l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length != 1).ToArray(); + + InputTypes = helpObject.GetNestedProperty("inputTypes", "inputType").EmptyIfNull().Select(it => it.ToTypeInfo()).ToArray(); + OutputTypes = helpObject.GetNestedProperty("returnValues", "returnValue").EmptyIfNull().Select(rv => rv.ToTypeInfo()).ToArray(); + Examples = helpObject.GetNestedProperty("examples", "example").EmptyIfNull().Select(e => e.ToExampleInfo()).ToArray(); + Aliases = helpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); + + Parameters = helpObject.GetNestedProperty("parameters", "parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + Syntax = helpObject.GetNestedProperty("syntax", "syntaxItem").EmptyIfNull().Select(si => si.ToSyntaxInfo()).ToArray(); + + Component = helpObject.GetProperty("Component"); + Functionality = helpObject.GetProperty("Functionality"); + PsSnapIn = helpObject.GetProperty("PSSnapIn"); + Role = helpObject.GetProperty("Role"); + NonTerminatingErrors = helpObject.GetProperty("nonTerminatingErrors"); + } + } + + internal class PsHelpTypeInfo + { + public string Name { get; } + public string Description { get; } + + public PsHelpTypeInfo(PSObject typeObject) + { + Name = typeObject.GetNestedProperty("type", "name").EmptyIfNull().Trim(); + Description = typeObject.GetProperty("description").EmptyIfNull().ToDescriptionText(); + } + } + + internal class PsHelpLinkInfo + { + public string Uri { get; } + public string Text { get; } + + public PsHelpLinkInfo(PSObject linkObject) + { + Uri = linkObject.GetProperty("uri"); + Text = linkObject.GetProperty("linkText"); + } + } + + internal class PsHelpSyntaxInfo + { + public string CmdletName { get; } + public PsParameterHelpInfo[] Parameters { get; } + + public PsHelpSyntaxInfo(PSObject syntaxObject) + { + CmdletName = syntaxObject.GetProperty("name"); + Parameters = syntaxObject.GetProperty("parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + } + } + + internal class PsHelpExampleInfo + { + public string Title { get; } + public string Code { get; } + public string Output { get; } + public string Remarks { get; } + + public PsHelpExampleInfo(PSObject exampleObject) + { + Title = exampleObject.GetProperty("title"); + Code = exampleObject.GetProperty("code"); + Output = exampleObject.GetProperty("output"); + Remarks = exampleObject.GetProperty("remarks").EmptyIfNull().ToDescriptionText(); + } + public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) + { + Title = markdownExample.Name; + Code = markdownExample.Code; + Output = markdownExample.Output; + Remarks = markdownExample.Description; + } + + public static implicit operator PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) => new PsHelpExampleInfo(markdownExample); + } + + internal class PsParameterHelpInfo + { + public string DefaultValueAsString { get; } + + public string Name { get; } + public string TypeName { get; } + public string Description { get; } + public string SupportsPipelineInput { get; } + public string PositionText { get; } + public string[] ParameterSetNames { get; } + public string[] Aliases { get; } + + public bool? SupportsGlobbing { get; } + public bool? IsRequired { get; } + public bool? IsVariableLength { get; } + public bool? IsDynamic { get; } + + public PsParameterHelpInfo(PSObject parameterHelpObject = null) + { + parameterHelpObject = parameterHelpObject ?? new PSObject(); + DefaultValueAsString = parameterHelpObject.GetProperty("defaultValue"); + Name = parameterHelpObject.GetProperty("name"); + TypeName = parameterHelpObject.GetProperty("parameterValue").NullIfEmpty() ?? parameterHelpObject.GetNestedProperty("type", "name"); + Description = parameterHelpObject.GetProperty("Description").EmptyIfNull().ToDescriptionText(); + SupportsPipelineInput = parameterHelpObject.GetProperty("pipelineInput"); + PositionText = parameterHelpObject.GetProperty("position"); + ParameterSetNames = parameterHelpObject.GetProperty("parameterSetName").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + Aliases = parameterHelpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + + SupportsGlobbing = parameterHelpObject.GetProperty("globbing").ToNullableBool(); + IsRequired = parameterHelpObject.GetProperty("required").ToNullableBool(); + IsVariableLength = parameterHelpObject.GetProperty("variableLength").ToNullableBool(); + IsDynamic = parameterHelpObject.GetProperty("isDynamic").ToNullableBool(); + } + } + + internal class PsModuleHelpInfo + { + public string Name { get; } + public Guid Guid { get; } + public string Description { get; } + + public PsModuleHelpInfo(PSModuleInfo moduleInfo) + : this(moduleInfo?.Name ?? String.Empty, moduleInfo?.Guid ?? Guid.NewGuid(), moduleInfo?.Description ?? String.Empty) + { + } + + public PsModuleHelpInfo(string name, Guid guid, string description) + { + Name = name; + Guid = guid; + Description = description; + } + } + + internal static class HelpTypesExtensions + { + public static PsHelpInfo ToPsHelpInfo(this PSObject helpObject) => new PsHelpInfo(helpObject); + public static PsParameterHelpInfo ToPsParameterHelpInfo(this PSObject parameterHelpObject) => new PsParameterHelpInfo(parameterHelpObject); + + public static string ToDescriptionText(this IEnumerable descriptionObject) => descriptionObject != null + ? String.Join(Environment.NewLine, descriptionObject.Select(dl => dl.GetProperty("Text").EmptyIfNull())).NullIfWhiteSpace() + : null; + public static PsHelpTypeInfo ToTypeInfo(this PSObject typeObject) => new PsHelpTypeInfo(typeObject); + public static PsHelpExampleInfo ToExampleInfo(this PSObject exampleObject) => new PsHelpExampleInfo(exampleObject); + public static PsHelpLinkInfo ToLinkInfo(this PSObject linkObject) => new PsHelpLinkInfo(linkObject); + public static PsHelpSyntaxInfo ToSyntaxInfo(this PSObject syntaxObject) => new PsHelpSyntaxInfo(syntaxObject); + public static PsModuleHelpInfo ToModuleInfo(this PSModuleInfo moduleInfo) => new PsModuleHelpInfo(moduleInfo); + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..cec4fe21f991 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -0,0 +1,294 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal class MarkdownHelpInfo + { + public string ExternalHelpFilename { get; } + public string ModuleName { get; } + public string OnlineVersion { get; } + public Version Schema { get; } + + public string CmdletName { get; } + public string[] Aliases { get; } + public string Synopsis { get; } + public string Description { get; } + + public MarkdownSyntaxHelpInfo[] SyntaxInfos { get; } + public MarkdownExampleHelpInfo[] Examples { get; } + public MarkdownParameterHelpInfo[] Parameters { get; } + + public string[] Inputs { get; } + public string[] Outputs { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + public string[] RelatedLinks { get; } + + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "") + { + ExternalHelpFilename = externalHelpFilename; + ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName; + var helpInfo = variantGroup.HelpInfo; + var commentInfo = variantGroup.CommentInfo; + Schema = Version.Parse("2.0.0"); + + CmdletName = variantGroup.CmdletName; + Aliases = (variantGroup.Aliases.NullIfEmpty() ?? helpInfo.Aliases).Where(a => a != "None").ToArray(); + Synopsis = commentInfo.Synopsis; + Description = commentInfo.Description; + + SyntaxInfos = variantGroup.Variants + .Select(v => new MarkdownSyntaxHelpInfo(v, variantGroup.ParameterGroups, v.VariantName == variantGroup.DefaultParameterSetName)) + .OrderByDescending(v => v.IsDefault).ThenBy(v => v.ParameterSetName).ToArray(); + Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty() + ?? helpInfo.Examples.Select(e => e.ToExampleHelpInfo()).ToArray().NullIfEmpty() + ?? DefaultExampleHelpInfos; + + Parameters = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && !pg.Parameters.All(p => p.IsHidden())) + .Select(pg => new MarkdownParameterHelpInfo( + variantGroup.Variants.SelectMany(v => v.HelpInfo.Parameters).Where(phi => phi.Name == pg.ParameterName).ToArray(), pg)) + .OrderBy(phi => phi.Name).ToArray(); + + Inputs = commentInfo.Inputs; + Outputs = commentInfo.Outputs; + + ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; + OnlineVersion = commentInfo.OnlineVersion; + RelatedLinks = commentInfo.RelatedLinks; + + SupportsShouldProcess = variantGroup.SupportsShouldProcess; + SupportsPaging = variantGroup.SupportsPaging; + } + + private MarkdownExampleHelpInfo[] GetExamplesFromMarkdown(string examplesFolder) + { + var filePath = Path.Combine(examplesFolder, $"{CmdletName}.md"); + if (!Directory.Exists(examplesFolder) || !File.Exists(filePath)) return null; + + var lines = File.ReadAllLines(filePath); + var nameIndices = lines.Select((l, i) => l.StartsWith(ExampleNameHeader) ? i : -1).Where(i => i != -1).ToArray(); + //https://codereview.stackexchange.com/a/187148/68772 + var indexCountGroups = nameIndices.Skip(1).Append(lines.Length).Zip(nameIndices, (next, current) => (NameIndex: current, LineCount: next - current)); + var exampleGroups = indexCountGroups.Select(icg => lines.Skip(icg.NameIndex).Take(icg.LineCount).ToArray()); + return exampleGroups.Select(eg => + { + var name = eg.First().Replace(ExampleNameHeader, String.Empty); + var codeStartIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var codeEndIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i != codeStartIndex); + var code = codeStartIndex.HasValue && codeEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1))) + : String.Empty; + var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex); + var output = outputStartIndex.HasValue && outputEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1))) + : String.Empty; + var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1; + descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex; + var descriptionEndIndex = eg.Length - 1; + descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex; + var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex)); + return new MarkdownExampleHelpInfo(name, code, output, description); + }).ToArray(); + } + } + + internal class MarkdownSyntaxHelpInfo + { + public Variant Variant { get; } + public bool IsDefault { get; } + public string ParameterSetName { get; } + public Parameter[] Parameters { get; } + public string SyntaxText { get; } + + public MarkdownSyntaxHelpInfo(Variant variant, ParameterGroup[] parameterGroups, bool isDefault) + { + Variant = variant; + IsDefault = isDefault; + ParameterSetName = Variant.VariantName; + Parameters = Variant.Parameters + .Where(p => !p.DontShow && !p.IsHidden()).OrderByDescending(p => p.IsMandatory) + //https://stackoverflow.com/a/6461526/294804 + .ThenByDescending(p => p.Position.HasValue).ThenBy(p => p.Position) + // Use the OrderCategory of the parameter group because the final order category is the highest of the group, and not the order category of the individual parameters from the variants. + .ThenBy(p => parameterGroups.First(pg => pg.ParameterName == p.ParameterName).OrderCategory).ThenBy(p => p.ParameterName).ToArray(); + SyntaxText = CreateSyntaxFormat(); + } + + //https://github.com/PowerShell/platyPS/blob/a607a926bfffe1e1a1e53c19e0057eddd0c07611/src/Markdown.MAML/Renderer/Markdownv2Renderer.cs#L29-L32 + private const int SyntaxLineWidth = 110; + private string CreateSyntaxFormat() + { + var parameterStrings = Parameters.Select(p => p.ToPropertySyntaxOutput().ToString()); + if (Variant.SupportsShouldProcess) + { + parameterStrings = parameterStrings.Append(" [-Confirm]").Append(" [-WhatIf]"); + } + parameterStrings = parameterStrings.Append(" []"); + + var lines = new List(20); + return parameterStrings.Aggregate(Variant.CmdletName, (current, ps) => + { + var combined = current + ps; + if (combined.Length <= SyntaxLineWidth) return combined; + + lines.Add(current); + return ps; + }, last => + { + lines.Add(last); + return String.Join(Environment.NewLine, lines); + }); + } + } + + internal class MarkdownExampleHelpInfo + { + public string Name { get; } + public string Code { get; } + public string Output { get; } + public string Description { get; } + + public MarkdownExampleHelpInfo(string name, string code, string output, string description) + { + Name = name; + Code = code; + Output = output; + Description = description; + } + } + + internal class MarkdownParameterHelpInfo + { + public string Name { get; set; } + public string Description { get; set; } + public Type Type { get; set; } + public string Position { get; set; } + public string DefaultValue { get; set; } + + public bool HasAllParameterSets { get; set; } + public string[] ParameterSetNames { get; set; } + public string[] Aliases { get; set; } + + public bool IsRequired { get; set; } + public bool IsDynamic { get; set; } + public bool AcceptsPipelineByValue { get; set; } + public bool AcceptsPipelineByPropertyName { get; set; } + public bool AcceptsWildcardCharacters { get; set; } + + // For use by common parameters that have no backing data in the objects themselves. + public MarkdownParameterHelpInfo() { } + + public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, ParameterGroup parameterGroup) + { + Name = parameterGroup.ParameterName; + Description = parameterGroup.Description.NullIfEmpty() + ?? parameterHelpInfos.Select(phi => phi.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + Type = parameterGroup.ParameterType; + Position = parameterGroup.FirstPosition?.ToString() + ?? parameterHelpInfos.Select(phi => phi.PositionText).FirstOrDefault(d => !String.IsNullOrEmpty(d)).ToUpperFirstCharacter().NullIfEmpty() + ?? "Named"; + // This no longer uses firstHelpInfo.DefaultValueAsString since it seems to be broken. For example, it has a value of 0 for Int32, but no default value was declared. + DefaultValue = parameterGroup.DefaultInfo?.Script ?? "None"; + + HasAllParameterSets = parameterGroup.HasAllVariants; + ParameterSetNames = (parameterGroup.Parameters.Select(p => p.VariantName).ToArray().NullIfEmpty() + ?? parameterHelpInfos.SelectMany(phi => phi.ParameterSetNames).Distinct()) + .OrderBy(psn => psn).ToArray(); + Aliases = parameterGroup.Aliases.NullIfEmpty() ?? parameterHelpInfos.SelectMany(phi => phi.Aliases).ToArray(); + + IsRequired = parameterHelpInfos.Select(phi => phi.IsRequired).FirstOrDefault(r => r == true) ?? parameterGroup.Parameters.Any(p => p.IsMandatory); + IsDynamic = parameterHelpInfos.Select(phi => phi.IsDynamic).FirstOrDefault(d => d == true) ?? false; + AcceptsPipelineByValue = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByValue")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipeline; + AcceptsPipelineByPropertyName = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByPropertyName")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipelineByPropertyName; + AcceptsWildcardCharacters = parameterGroup.SupportsWildcards; + } + } + + 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 }}"), + }; + + public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = + { + new MarkdownParameterHelpInfo + { + Name = "Confirm", + Description ="Prompts you for confirmation before running the cmdlet.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "cf" } + }, + new MarkdownParameterHelpInfo + { + Name = "WhatIf", + Description ="Shows what would happen if the cmdlet runs. The cmdlet is not run.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "wi" } + } + }; + + public static MarkdownParameterHelpInfo[] SupportsPagingParameters = + { + new MarkdownParameterHelpInfo + { + Name = "First", + Description ="Gets only the first 'n' objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "IncludeTotalCount", + Description ="Reports the number of objects in the data set (an integer) followed by the objects. If the cmdlet cannot determine the total count, it returns \"Unknown total count\".", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "Skip", + Description ="Ignores the first 'n' objects and then gets the remaining objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + } + }; + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..7907cfe3551b --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -0,0 +1,611 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal class OutputTypeOutput + { + public PSTypeName[] OutputTypes { get; } + + public OutputTypeOutput(IEnumerable outputTypes) + { + OutputTypes = outputTypes.ToArray(); + } + + public override string ToString() => OutputTypes != null && OutputTypes.Any() ? $"[OutputType({OutputTypes.Select(ot => $"[{ot}]").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class CmdletBindingOutput + { + public VariantGroup VariantGroup { get; } + + public CmdletBindingOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + + public override string ToString() + { + var dpsText = VariantGroup.DefaultParameterSetName.IsValidDefaultParameterSetName() ? $"DefaultParameterSetName='{VariantGroup.DefaultParameterSetName}'" : String.Empty; + var sspText = VariantGroup.SupportsShouldProcess ? $"SupportsShouldProcess{ItemSeparator}ConfirmImpact='Medium'" : String.Empty; + var pbText = $"PositionalBinding={false.ToPsBool()}"; + var propertyText = new[] { dpsText, pbText, sspText }.JoinIgnoreEmpty(ItemSeparator); + return $"[CmdletBinding({propertyText})]{Environment.NewLine}"; + } + } + + internal class ParameterOutput + { + public Parameter Parameter { get; } + public bool HasMultipleVariantsInVariantGroup { get; } + public bool HasAllVariantsInParameterGroup { get; } + + public ParameterOutput(Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) + { + Parameter = parameter; + HasMultipleVariantsInVariantGroup = hasMultipleVariantsInVariantGroup; + HasAllVariantsInParameterGroup = hasAllVariantsInParameterGroup; + } + + public override string ToString() + { + var psnText = HasMultipleVariantsInVariantGroup && !HasAllVariantsInParameterGroup ? $"ParameterSetName='{Parameter.VariantName}'" : String.Empty; + var positionText = Parameter.Position != null ? $"Position={Parameter.Position}" : String.Empty; + var mandatoryText = Parameter.IsMandatory ? "Mandatory" : String.Empty; + var dontShowText = Parameter.DontShow ? "DontShow" : String.Empty; + var vfpText = Parameter.ValueFromPipeline ? "ValueFromPipeline" : String.Empty; + var vfpbpnText = Parameter.ValueFromPipelineByPropertyName ? "ValueFromPipelineByPropertyName" : String.Empty; + var propertyText = new[] { psnText, positionText, mandatoryText, dontShowText, vfpText, vfpbpnText }.JoinIgnoreEmpty(ItemSeparator); + return $"{Indent}[Parameter({propertyText})]{Environment.NewLine}"; + } + } + + internal class AliasOutput + { + public string[] Aliases { get; } + public bool IncludeIndent { get; } + + public AliasOutput(string[] aliases, bool includeIndent = false) + { + Aliases = aliases; + IncludeIndent = includeIndent; + } + + public override string ToString() => Aliases?.Any() ?? false ? $"{(IncludeIndent ? Indent : String.Empty)}[Alias({Aliases.Select(an => $"'{an}'").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class ValidateNotNullOutput + { + public bool HasValidateNotNull { get; } + + public ValidateNotNullOutput(bool hasValidateNotNull) + { + HasValidateNotNull = hasValidateNotNull; + } + + public override string ToString() => HasValidateNotNull ? $"{Indent}[ValidateNotNull()]{Environment.NewLine}" : String.Empty; + } + + internal class AllowEmptyArrayOutput + { + public bool HasAllowEmptyArray { get; } + + public AllowEmptyArrayOutput(bool hasAllowEmptyArray) + { + HasAllowEmptyArray = hasAllowEmptyArray; + } + + public override string ToString() => HasAllowEmptyArray ? $"{Indent}[AllowEmptyCollection()]{Environment.NewLine}" : String.Empty; + } + internal class ArgumentCompleterOutput + { + public CompleterInfo CompleterInfo { get; } + + public ArgumentCompleterOutput(CompleterInfo completerInfo) + { + CompleterInfo = completerInfo; + } + + public override string ToString() => CompleterInfo != null + ? $"{Indent}[ArgumentCompleter({(CompleterInfo.IsTypeCompleter ? $"[{CompleterInfo.Type.Unwrap().ToPsType()}]" : $"{{{CompleterInfo.Script.ToPsSingleLine("; ")}}}")})]{Environment.NewLine}" + : String.Empty; + } + + internal class DefaultInfoOutput + { + public bool HasDefaultInfo { get; } + public DefaultInfo DefaultInfo { get; } + + public DefaultInfoOutput(ParameterGroup parameterGroup) + { + HasDefaultInfo = parameterGroup.HasDefaultInfo; + DefaultInfo = parameterGroup.DefaultInfo; + } + + public override string ToString() + { + var nameText = !String.IsNullOrEmpty(DefaultInfo?.Name) ? $"Name='{DefaultInfo?.Name}'" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(DefaultInfo?.Description) ? $"Description='{DefaultInfo?.Description.ToPsStringLiteral()}'" : String.Empty; + var scriptText = !String.IsNullOrEmpty(DefaultInfo?.Script) ? $"Script='{DefaultInfo?.Script.ToPsSingleLine("; ")}'" : String.Empty; + var propertyText = new[] { nameText, descriptionText, scriptText }.JoinIgnoreEmpty(ItemSeparator); + return HasDefaultInfo ? $"{Indent}[{typeof(DefaultInfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class ParameterTypeOutput + { + public Type ParameterType { get; } + + public ParameterTypeOutput(Type parameterType) + { + ParameterType = parameterType; + } + + public override string ToString() => $"{Indent}[{ParameterType.ToPsType()}]{Environment.NewLine}"; + } + + internal class ParameterNameOutput + { + public string ParameterName { get; } + public bool IsLast { get; } + + public ParameterNameOutput(string parameterName, bool isLast) + { + ParameterName = parameterName; + IsLast = isLast; + } + + public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}"; + } + + internal class BaseOutput + { + public VariantGroup VariantGroup { get; } + + protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + public string ClearTelemetryContext() + { + return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : ""; + } + } + + internal class BeginOutput : BaseOutput + { + public BeginOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + public string GetProcessCustomAttributesAtRuntime() + { + return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + } + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() +{Indent}{Indent}}} +{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' +{Indent}{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"begin {{ +{Indent}try {{ +{Indent}{Indent}$outBuffer = $null +{Indent}{Indent}if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {{ +{Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 +{Indent}{Indent}}} +{Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName +{GetTelemetry()} +{GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} +{GetProcessCustomAttributesAtRuntime()} +{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} +{Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) +{Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} + +"; + + private string GetParameterSetToCmdletMapping() + { + var sb = new StringBuilder(); + sb.AppendLine($"{Indent}{Indent}$mapping = @{{"); + foreach (var variant in VariantGroup.Variants) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}{variant.VariantName} = '{variant.PrivateModuleName}\{variant.PrivateCmdletName}';"); + } + sb.Append($"{Indent}{Indent}}}"); + return sb.ToString(); + } + + private string GetDefaultValuesStatements() + { + var defaultInfos = VariantGroup.ParameterGroups.Where(pg => pg.HasDefaultInfo).Select(pg => pg.DefaultInfo).ToArray(); + var sb = new StringBuilder(); + + foreach (var defaultInfo in defaultInfos) + { + var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); + var parameterName = defaultInfo.ParameterGroup.ParameterName; + sb.AppendLine(); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } + return sb.ToString(); + } + } + + internal class ProcessOutput : BaseOutput + { + public ProcessOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetFinally() + { + if (IsAzure && !VariantGroup.IsInternal) + { + return $@" +{Indent}finally {{ +{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"process {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.Process($_) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +{GetFinally()} +}} +"; + } + + internal class EndOutput : BaseOutput + { + public EndOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Cost.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}{Indent}}} +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId +"; + } + return ""; + } + public override string ToString() => $@"end {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.End() +{GetTelemetry()} +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} +"; + } + + internal class HelpCommentOutput + { + public VariantGroup VariantGroup { get; } + public CommentInfo CommentInfo { get; } + + public HelpCommentOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + CommentInfo = variantGroup.CommentInfo; + } + + public override string ToString() + { + var inputs = String.Join(Environment.NewLine, CommentInfo.Inputs.Select(i => $".Inputs{Environment.NewLine}{i}")); + var inputsText = !String.IsNullOrEmpty(inputs) ? $"{Environment.NewLine}{inputs}" : String.Empty; + var outputs = String.Join(Environment.NewLine, CommentInfo.Outputs.Select(o => $".Outputs{Environment.NewLine}{o}")); + var outputsText = !String.IsNullOrEmpty(outputs) ? $"{Environment.NewLine}{outputs}" : String.Empty; + var notes = String.Join($"{Environment.NewLine}{Environment.NewLine}", VariantGroup.ComplexInterfaceInfos.Select(cii => cii.ToNoteOutput())); + 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 examples = ""; + foreach (var example in VariantGroup.HelpInfo.Examples) + { + examples = examples + ".Example" + "\r\n" + example.Code + "\r\n"; + } + return $@"<# +.Synopsis +{CommentInfo.Synopsis.ToDescriptionFormat(false)} +.Description +{CommentInfo.Description.ToDescriptionFormat(false)} +{examples}{inputsText}{outputsText}{notesText} +.Link +{CommentInfo.OnlineVersion}{relatedLinksText} +#> +"; + } + } + + internal class ParameterDescriptionOutput + { + public string Description { get; } + + public ParameterDescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) + ? Description.ToDescriptionFormat(false).NormalizeNewLines() + .Split(new[] { Environment.NewLine }, StringSplitOptions.None) + .Aggregate(String.Empty, (c, n) => c + $"{Indent}# {n}{Environment.NewLine}") + : String.Empty; + } + + internal class ProfileOutput + { + public string ProfileName { get; } + + public ProfileOutput(string profileName) + { + ProfileName = profileName; + } + + public override string ToString() => ProfileName != NoProfiles ? $"[{typeof(ProfileAttribute).ToPsAttributeType()}('{ProfileName}')]{Environment.NewLine}" : String.Empty; + } + + internal class DescriptionOutput + { + public string Description { get; } + + public DescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) ? $"[{typeof(DescriptionAttribute).ToPsAttributeType()}('{Description.ToPsStringLiteral()}')]{Environment.NewLine}" : String.Empty; + } + + internal class ParameterCategoryOutput + { + public ParameterCategory Category { get; } + + public ParameterCategoryOutput(ParameterCategory category) + { + Category = category; + } + + public override string ToString() => $"{Indent}[{typeof(CategoryAttribute).ToPsAttributeType()}('{Category}')]{Environment.NewLine}"; + } + + internal class InfoOutput + { + public InfoAttribute Info { get; } + public Type ParameterType { get; } + + public InfoOutput(InfoAttribute info, Type parameterType) + { + Info = info; + ParameterType = parameterType; + } + + public override string ToString() + { + // Rendering of InfoAttribute members that are not used currently + /*var serializedNameText = Info.SerializedName != null ? $"SerializedName='{Info.SerializedName}'" : String.Empty; + var readOnlyText = Info.ReadOnly ? "ReadOnly" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(Info.Description) ? $"Description='{Info.Description.ToPsStringLiteral()}'" : String.Empty;*/ + + var requiredText = Info.Required ? "Required" : String.Empty; + var unwrappedType = ParameterType.Unwrap(); + var hasValidPossibleTypes = Info.PossibleTypes.Any(pt => pt != unwrappedType); + var possibleTypesText = hasValidPossibleTypes + ? $"PossibleTypes=({Info.PossibleTypes.Select(pt => $"[{pt.ToPsType()}]").JoinIgnoreEmpty(ItemSeparator)})" + : String.Empty; + var propertyText = new[] { /*serializedNameText, */requiredText,/* readOnlyText,*/ possibleTypesText/*, descriptionText*/ }.JoinIgnoreEmpty(ItemSeparator); + return hasValidPossibleTypes ? $"{Indent}[{typeof(InfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class PropertySyntaxOutput + { + public string ParameterName { get; } + public Type ParameterType { get; } + public bool IsMandatory { get; } + public int? Position { get; } + + public bool IncludeSpace { get; } + public bool IncludeDash { get; } + + public PropertySyntaxOutput(Parameter parameter) + { + ParameterName = parameter.ParameterName; + ParameterType = parameter.ParameterType; + IsMandatory = parameter.IsMandatory; + Position = parameter.Position; + IncludeSpace = true; + IncludeDash = true; + } + + public PropertySyntaxOutput(ComplexInterfaceInfo complexInterfaceInfo) + { + ParameterName = complexInterfaceInfo.Name; + ParameterType = complexInterfaceInfo.Type; + IsMandatory = complexInterfaceInfo.Required; + Position = null; + IncludeSpace = false; + IncludeDash = false; + } + + public override string ToString() + { + var leftOptional = !IsMandatory ? "[" : String.Empty; + var leftPositional = Position != null ? "[" : String.Empty; + var rightPositional = Position != null ? "]" : String.Empty; + var type = ParameterType != typeof(SwitchParameter) ? $" <{ParameterType.ToSyntaxTypeName()}>" : String.Empty; + var rightOptional = !IsMandatory ? "]" : String.Empty; + var space = IncludeSpace ? " " : String.Empty; + var dash = IncludeDash ? "-" : String.Empty; + return $"{space}{leftOptional}{leftPositional}{dash}{ParameterName}{rightPositional}{type}{rightOptional}"; + } + } + + internal static class PsProxyOutputExtensions + { + public const string NoParameters = "__NoParameters"; + + public const string AllParameterSets = "__AllParameterSets"; + + public const string HalfIndent = " "; + + public const string Indent = HalfIndent + HalfIndent; + + public const string ItemSeparator = ", "; + + public static readonly string ComplexParameterHeader = $"COMPLEX PARAMETER PROPERTIES{Environment.NewLine}{Environment.NewLine}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.{Environment.NewLine}{Environment.NewLine}"; + + public static string ToPsBool(this bool value) => $"${value.ToString().ToLowerInvariant()}"; + + public static string ToPsType(this Type type) + { + var regex = new Regex(@"^(.*)`{1}\d+(.*)$"); + var typeText = type.ToString(); + var match = regex.Match(typeText); + return match.Success ? $"{match.Groups[1]}{match.Groups[2]}" : typeText; + } + + public static string ToPsAttributeType(this Type type) => type.ToPsType().RemoveEnd("Attribute"); + + // https://stackoverflow.com/a/5284606/294804 + private static string RemoveEnd(this string text, string suffix) => text.EndsWith(suffix) ? text.Substring(0, text.Length - suffix.Length) : text; + + public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new[] { "
", "\r\n", "\n" }); + + public static string ToPsStringLiteral(this string value) => value?.Replace("'", "''").Replace("‘", "''").Replace("’", "''").ToPsSingleLine().Trim() ?? String.Empty; + + public static string JoinIgnoreEmpty(this IEnumerable values, string separator) => String.Join(separator, values?.Where(v => !String.IsNullOrEmpty(v))); + + // https://stackoverflow.com/a/41961738/294804 + public static string ToSyntaxTypeName(this Type type) + { + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return $"{type.GetGenericArguments().First().ToSyntaxTypeName()}?"; + } + + if (type.IsGenericType) + { + var genericTypes = String.Join(ItemSeparator, type.GetGenericArguments().Select(ToSyntaxTypeName)); + return $"{type.Name.Split('`').First()}<{genericTypes}>"; + } + + return type.Name; + } + + public static OutputTypeOutput ToOutputTypeOutput(this IEnumerable outputTypes) => new OutputTypeOutput(outputTypes); + + public static CmdletBindingOutput ToCmdletBindingOutput(this VariantGroup variantGroup) => new CmdletBindingOutput(variantGroup); + + public static ParameterOutput ToParameterOutput(this Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) => new ParameterOutput(parameter, hasMultipleVariantsInVariantGroup, hasAllVariantsInParameterGroup); + + public static AliasOutput ToAliasOutput(this string[] aliases, bool includeIndent = false) => new AliasOutput(aliases, includeIndent); + + public static ValidateNotNullOutput ToValidateNotNullOutput(this bool hasValidateNotNull) => new ValidateNotNullOutput(hasValidateNotNull); + + public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); + + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + + public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); + + public static ParameterTypeOutput ToParameterTypeOutput(this Type parameterType) => new ParameterTypeOutput(parameterType); + + public static ParameterNameOutput ToParameterNameOutput(this string parameterName, bool isLast) => new ParameterNameOutput(parameterName, isLast); + + public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup); + + public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup); + + public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup); + + public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup); + + public static ParameterDescriptionOutput ToParameterDescriptionOutput(this string description) => new ParameterDescriptionOutput(description); + + public static ProfileOutput ToProfileOutput(this string profileName) => new ProfileOutput(profileName); + + public static DescriptionOutput ToDescriptionOutput(this string description) => new DescriptionOutput(description); + + public static ParameterCategoryOutput ToParameterCategoryOutput(this ParameterCategory category) => new ParameterCategoryOutput(category); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this Parameter parameter) => new PropertySyntaxOutput(parameter); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this ComplexInterfaceInfo complexInterfaceInfo) => new PropertySyntaxOutput(complexInterfaceInfo); + + public static InfoOutput ToInfoOutput(this InfoAttribute info, Type parameterType) => new InfoOutput(info, parameterType); + + public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true) + { + string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) => + $"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}"; + + var nested = complexInterfaceInfo.NestedInfos.Select(ni => + { + var nestedIndent = $"{currentIndent}{HalfIndent}"; + return ni.IsComplexInterface + ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false) + : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks); + }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, includeBackticks)); + return String.Join(Environment.NewLine, nested); + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..503282ede536 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -0,0 +1,514 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal class ProfileGroup + { + public string ProfileName { get; } + public Variant[] Variants { get; } + public string ProfileFolder { get; } + + public ProfileGroup(Variant[] variants, string profileName = NoProfiles) + { + ProfileName = profileName; + Variants = variants; + ProfileFolder = ProfileName != NoProfiles ? ProfileName : String.Empty; + } + } + + internal class VariantGroup + { + public string ModuleName { get; } + + public string RootModuleName {get => @"";} + public string CmdletName { get; } + public string CmdletVerb { get; } + public string CmdletNoun { get; } + public string ProfileName { get; } + public Variant[] Variants { get; } + public ParameterGroup[] ParameterGroups { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + + public string[] Aliases { get; } + public PSTypeName[] OutputTypes { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + public string DefaultParameterSetName { get; } + public bool HasMultipleVariants { get; } + public PsHelpInfo HelpInfo { get; } + public bool IsGenerated { get; } + public bool IsInternal { get; } + + public string OutputFolder { get; } + public string FileName { get; } + public string FilePath { get; } + + public CommentInfo CommentInfo { get; } + + public VariantGroup(string moduleName, string cmdletName, Variant[] variants, string outputFolder, string profileName = NoProfiles, bool isTest = false, bool isInternal = false) + { + ModuleName = moduleName; + CmdletName = cmdletName; + var cmdletNameParts = CmdletName.Split('-'); + CmdletVerb = cmdletNameParts.First(); + CmdletNoun = cmdletNameParts.Last(); + ProfileName = profileName; + Variants = variants; + ParameterGroups = Variants.ToParameterGroups().OrderBy(pg => pg.OrderCategory).ThenByDescending(pg => pg.IsMandatory).ToArray(); + var aliasDuplicates = ParameterGroups.SelectMany(pg => pg.Aliases) + //https://stackoverflow.com/a/18547390/294804 + .GroupBy(a => a).Where(g => g.Count() > 1).Select(g => g.Key).ToArray(); + if (aliasDuplicates.Any()) + { + throw new ParsingMetadataException($"The alias(es) [{String.Join(", ", aliasDuplicates)}] are defined on multiple parameters for cmdlet '{CmdletName}', which is not supported."); + } + ComplexInterfaceInfos = ParameterGroups.Where(pg => !pg.DontShow && pg.IsComplexInterface).OrderBy(pg => pg.ParameterName).Select(pg => pg.ComplexInterfaceInfo).ToArray(); + + Aliases = Variants.SelectMany(v => v.Attributes).ToAliasNames().ToArray(); + OutputTypes = Variants.SelectMany(v => v.Info.OutputType).Where(ot => ot.Type != null).GroupBy(ot => ot.Type).Select(otg => otg.First()).ToArray(); + SupportsShouldProcess = Variants.Any(v => v.SupportsShouldProcess); + SupportsPaging = Variants.Any(v => v.SupportsPaging); + DefaultParameterSetName = DetermineDefaultParameterSetName(); + HasMultipleVariants = Variants.Length > 1; + HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); + IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); + IsInternal = isInternal; + + OutputFolder = outputFolder; + FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; + FilePath = Path.Combine(OutputFolder, FileName); + + CommentInfo = new CommentInfo(this); + } + + private string DetermineDefaultParameterSetName() + { + var defaultParameterSet = Variants + .Select(v => v.Metadata.DefaultParameterSetName) + .LastOrDefault(dpsn => dpsn.IsValidDefaultParameterSetName()); + + if (String.IsNullOrEmpty(defaultParameterSet)) + { + var 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; + } + + return defaultParameterSet; + } + } + + internal class Variant + { + public string CmdletName { get; } + public string VariantName { get; } + public CommandInfo Info { get; } + public CommandMetadata Metadata { get; } + public PsHelpInfo HelpInfo { get; } + public bool HasParameterSets { get; } + public bool IsFunction { get; } + public string PrivateModuleName { get; } + public string PrivateCmdletName { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public Attribute[] Attributes { get; } + public Parameter[] Parameters { get; } + public Parameter[] CmdletOnlyParameters { get; } + public bool IsInternal { get; } + public bool IsDoNotExport { get; } + public string[] Profiles { get; } + + public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) + { + CmdletName = cmdletName; + VariantName = variantName; + Info = info; + HelpInfo = helpInfo ?? new PsHelpInfo(); + Metadata = metadata; + HasParameterSets = hasParameterSets; + IsFunction = Info.CommandType == CommandTypes.Function; + PrivateModuleName = Info.Source; + PrivateCmdletName = Metadata.Name; + SupportsShouldProcess = Metadata.SupportsShouldProcess; + SupportsPaging = Metadata.SupportsPaging; + + Attributes = this.ToAttributes(); + Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); + IsInternal = Attributes.OfType().Any(); + IsDoNotExport = 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(); + } + } + + internal class ParameterGroup + { + public string ParameterName { get; } + public Parameter[] Parameters { get; } + + public string[] VariantNames { get; } + public string[] AllVariantNames { get; } + public bool HasAllVariants { get; } + public Type ParameterType { get; } + public string Description { get; } + + public string[] Aliases { get; } + public bool HasValidateNotNull { get; } + public bool HasAllowEmptyArray { get; } + public CompleterInfo CompleterInfo { get; } + public DefaultInfo DefaultInfo { get; } + public bool HasDefaultInfo { get; } + public ParameterCategory OrderCategory { get; } + public bool DontShow { get; } + public bool IsMandatory { get; } + public bool SupportsWildcards { get; } + public bool IsComplexInterface { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public InfoAttribute InfoAttribute { get; } + + public int? FirstPosition { get; } + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public bool IsInputType { get; } + + public ParameterGroup(string parameterName, Parameter[] parameters, string[] allVariantNames) + { + ParameterName = parameterName; + Parameters = parameters; + + VariantNames = Parameters.Select(p => p.VariantName).ToArray(); + AllVariantNames = allVariantNames; + HasAllVariants = VariantNames.Any(vn => vn == AllParameterSets) || !AllVariantNames.Except(VariantNames).Any(); + var types = Parameters.Select(p => p.ParameterType).Distinct().ToArray(); + if (types.Length > 1) + { + throw new ParsingMetadataException($"The parameter '{ParameterName}' has multiple parameter types [{String.Join(", ", types.Select(t => t.Name))}] defined, which is not supported."); + } + ParameterType = types.First(); + Description = Parameters.Select(p => p.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + + Aliases = Parameters.SelectMany(p => p.Attributes).ToAliasNames().ToArray(); + 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.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); + DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) + ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); + HasDefaultInfo = DefaultInfo != null && !String.IsNullOrEmpty(DefaultInfo.Script); + // When DefaultInfo is present, force all parameters from this group to be optional. + if (HasDefaultInfo) + { + foreach (var parameter in Parameters) + { + parameter.IsMandatory = false; + } + } + OrderCategory = Parameters.Select(p => p.OrderCategory).Distinct().DefaultIfEmpty(ParameterCategory.Body).Min(); + DontShow = Parameters.All(p => p.DontShow); + IsMandatory = HasAllVariants && Parameters.Any(p => p.IsMandatory); + SupportsWildcards = Parameters.Any(p => p.SupportsWildcards); + IsComplexInterface = Parameters.Any(p => p.IsComplexInterface); + ComplexInterfaceInfo = Parameters.Where(p => p.IsComplexInterface).Select(p => p.ComplexInterfaceInfo).FirstOrDefault(); + InfoAttribute = Parameters.Select(p => p.InfoAttribute).First(); + + FirstPosition = Parameters.Select(p => p.Position).FirstOrDefault(p => p != null); + ValueFromPipeline = Parameters.Any(p => p.ValueFromPipeline); + ValueFromPipelineByPropertyName = Parameters.Any(p => p.ValueFromPipelineByPropertyName); + IsInputType = ValueFromPipeline || ValueFromPipelineByPropertyName; + } + } + + internal class Parameter + { + public string VariantName { get; } + public string ParameterName { get; } + public ParameterMetadata Metadata { get; } + public PsParameterHelpInfo HelpInfo { get; } + public Type ParameterType { get; } + + public Attribute[] Attributes { get; } + public ParameterCategory[] Categories { get; } + public ParameterCategory OrderCategory { get; } + public PSDefaultValueAttribute DefaultValueAttribute { get; } + public DefaultInfoAttribute DefaultInfoAttribute { get; } + public ParameterAttribute ParameterAttribute { get; } + public bool SupportsWildcards { get; } + public CompleterInfoAttribute CompleterInfoAttribute { get; } + public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public int? Position { get; } + public bool DontShow { get; } + public bool IsMandatory { get; set; } + + public InfoAttribute InfoAttribute { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public bool IsComplexInterface { get; } + public string Description { get; } + + public Parameter(string variantName, string parameterName, ParameterMetadata metadata, PsParameterHelpInfo helpInfo = null) + { + VariantName = variantName; + ParameterName = parameterName; + Metadata = metadata; + HelpInfo = helpInfo ?? new PsParameterHelpInfo(); + + Attributes = Metadata.Attributes.ToArray(); + ParameterType = Attributes.OfType().FirstOrDefault()?.Type ?? Metadata.ParameterType; + Categories = Attributes.OfType().SelectMany(ca => ca.Categories).Distinct().ToArray(); + OrderCategory = Categories.DefaultIfEmpty(ParameterCategory.Body).Min(); + DefaultValueAttribute = Attributes.OfType().FirstOrDefault(); + DefaultInfoAttribute = Attributes.OfType().FirstOrDefault(); + ParameterAttribute = Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == VariantName || pa.ParameterSetName == AllParameterSets); + if (ParameterAttribute == null) + { + throw new ParsingMetadataException($"The variant '{VariantName}' has multiple parameter sets defined, which is not supported."); + } + SupportsWildcards = Attributes.OfType().Any(); + CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + + ValueFromPipeline = ParameterAttribute.ValueFromPipeline; + ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; + Position = ParameterAttribute.Position == Int32.MinValue ? (int?)null : ParameterAttribute.Position; + DontShow = ParameterAttribute.DontShow; + 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 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); + // 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 + InfoAttribute.Description = String.IsNullOrEmpty(InfoAttribute.Description) ? description : InfoAttribute.Description; + ComplexInterfaceInfo = InfoAttribute.ToComplexInterfaceInfo(complexParameterName, ParameterType, true); + IsComplexInterface = ComplexInterfaceInfo.IsComplexInterface; + Description = $"{description}{(IsComplexInterface ? complexMessage : String.Empty)}"; + } + } + + internal class ComplexInterfaceInfo + { + public InfoAttribute InfoAttribute { get; } + + public string Name { get; } + public Type Type { get; } + public bool Required { get; } + public bool ReadOnly { get; } + public string Description { get; } + + public ComplexInterfaceInfo[] NestedInfos { get; } + public bool IsComplexInterface { get; } + + public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, bool? required, List seenTypes) + { + Name = name; + Type = type; + InfoAttribute = infoAttribute; + + Required = required ?? InfoAttribute.Required; + ReadOnly = InfoAttribute.ReadOnly; + Description = InfoAttribute.Description.ToPsSingleLine(); + + var unwrappedType = Type.Unwrap(); + var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; + (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + unwrappedType.GetInterfaces() + .Concat(InfoAttribute.PossibleTypes) + .SelectMany(pt => pt.GetProperties() + .SelectMany(pi => pi.GetCustomAttributes(true).OfType() + .Select(ia => ia.ToComplexInterfaceInfo(pi.Name, pi.PropertyType, seenTypes: seenTypes)))) + .Where(cii => !cii.ReadOnly).OrderByDescending(cii => cii.Required).ToArray(); + // https://stackoverflow.com/a/503359/294804 + var associativeArrayInnerType = Type.GetInterfaces() + .FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>)) + ?.GetTypeInfo().GetGenericArguments().First(); + if (!hasBeenSeen && associativeArrayInnerType != null) + { + var anyInfo = new InfoAttribute { Description = "This indicates any property can be added to this object." }; + NestedInfos = NestedInfos.Prepend(anyInfo.ToComplexInterfaceInfo("(Any)", associativeArrayInnerType)).ToArray(); + } + IsComplexInterface = NestedInfos.Any(); + } + } + + internal class CommentInfo + { + public string Description { get; } + public string Synopsis { get; } + + public string[] Examples { get; } + public string[] Inputs { get; } + public string[] Outputs { get; } + + public string OnlineVersion { get; } + public string[] RelatedLinks { get; } + + private const string HelpLinkPrefix = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public CommentInfo(VariantGroup variantGroup) + { + var helpInfo = variantGroup.HelpInfo; + Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() + ?? helpInfo.Description.EmptyIfNull(); + // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. + var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; + Synopsis = synopsis.NullIfEmpty() ?? Description; + + Examples = helpInfo.Examples.Select(rl => rl.Code).ToArray(); + + Inputs = (variantGroup.ParameterGroups.Where(pg => pg.IsInputType).Select(pg => pg.ParameterType.FullName).ToArray().NullIfEmpty() ?? + helpInfo.InputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(it => it.Name).ToArray()) + .Where(i => i != "None").Distinct().OrderBy(i => i).ToArray(); + Outputs = (variantGroup.OutputTypes.Select(ot => ot.Type.FullName).ToArray().NullIfEmpty() ?? + helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray()) + .Where(o => o != "None").Distinct().OrderBy(o => o).ToArray(); + + // Use root module name in the help link + 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(); + } + } + + internal class CompleterInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public Type Type { get; } + public bool IsTypeCompleter { get; } + + public CompleterInfo(CompleterInfoAttribute infoAttribute) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + } + + public CompleterInfo(ArgumentCompleterAttribute completerAttribute) + { + Script = completerAttribute.ScriptBlock?.ToString(); + if (completerAttribute.Type != null) + { + Type = completerAttribute.Type; + IsTypeCompleter = true; + } + } + } + + internal class DefaultInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public ParameterGroup ParameterGroup { get; } + + public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + ParameterGroup = parameterGroup; + } + + public DefaultInfo(PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) + { + Description = defaultValueAttribute.Help; + ParameterGroup = parameterGroup; + if (defaultValueAttribute.Value != null) + { + Script = defaultValueAttribute.Value.ToString(); + } + } + } + + internal static class PsProxyTypeExtensions + { + public const string NoProfiles = "__NoProfiles"; + + public static bool IsValidDefaultParameterSetName(this string parameterSetName) => + !String.IsNullOrEmpty(parameterSetName) && parameterSetName != AllParameterSets; + + public static Variant[] ToVariants(this CommandInfo info, PsHelpInfo helpInfo) + { + var metadata = new CommandMetadata(info); + var privateCmdletName = metadata.Name.Split('!').First(); + var parts = privateCmdletName.Split('_'); + return parts.Length > 1 + ? new[] { new Variant(parts[0], parts[1], info, metadata, helpInfo: helpInfo) } + // Process multiple parameter sets, so we declare a variant per parameter set. + : info.ParameterSets.Select(ps => new Variant(privateCmdletName, ps.Name, info, metadata, true, helpInfo)).ToArray(); + } + + public static Variant[] ToVariants(this CmdletAndHelpInfo info) => info.CommandInfo.ToVariants(info.HelpInfo); + + public static Variant[] ToVariants(this CommandInfo info, PSObject helpInfo = null) => info.ToVariants(helpInfo?.ToPsHelpInfo()); + + public static Parameter[] ToParameters(this Variant variant) + { + var parameters = variant.Metadata.Parameters.AsEnumerable(); + var parameterHelp = variant.HelpInfo.Parameters.AsEnumerable(); + + if (variant.HasParameterSets) + { + parameters = parameters.Where(p => p.Value.ParameterSets.Keys.Any(k => k == variant.VariantName || k == AllParameterSets)); + 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 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."; + result = result.Append(new Parameter(variant.VariantName, "First", variant.Info.Parameters["First"], parameterHelp.FirstOrDefault(ph => ph.Name == "First"))); + result = result.Append(new Parameter(variant.VariantName, "Skip", variant.Info.Parameters["Skip"], parameterHelp.FirstOrDefault(ph => ph.Name == "Skip"))); + } + return result.ToArray(); + } + + public static Attribute[] ToAttributes(this Variant variant) => variant.IsFunction + ? ((FunctionInfo)variant.Info).ScriptBlock.Attributes.ToArray() + : variant.Metadata.CommandType.GetCustomAttributes(false).Cast().ToArray(); + + public static IEnumerable ToParameterGroups(this Variant[] variants) + { + var allVariantNames = variants.Select(vg => vg.VariantName).ToArray(); + return variants + .SelectMany(v => v.Parameters) + .GroupBy(p => p.ParameterName, StringComparer.InvariantCultureIgnoreCase) + .Select(pg => new ParameterGroup(pg.Key, pg.Select(p => p).ToArray(), allVariantNames)); + } + + public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute infoAttribute, string name, Type type, bool? required = null, List seenTypes = null) + => new ComplexInterfaceInfo(name, type, infoAttribute, required, seenTypes); + + public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); + public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(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/swaggerci/cost-management/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/cost-management/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..a74499a01cfa --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/PsAttributes.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost +{ + [AttributeUsage(AttributeTargets.Class)] + public class DescriptionAttribute : Attribute + { + public string Description { get; } + + public DescriptionAttribute(string description) + { + Description = description; + } + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class InternalExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class GeneratedAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotFormatAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class ProfileAttribute : Attribute + { + public string[] Profiles { get; } + + public ProfileAttribute(params string[] profiles) + { + Profiles = profiles; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class CategoryAttribute : Attribute + { + public ParameterCategory[] Categories { get; } + + public CategoryAttribute(params ParameterCategory[] categories) + { + Categories = categories; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class ExportAsAttribute : Attribute + { + public Type Type { get; set; } + + public ExportAsAttribute(Type type) + { + Type = type; + } + } + + public enum ParameterCategory + { + // Note: Order is significant + Uri = 0, + Path, + Query, + Header, + Cookie, + Body, + Azure, + Runtime + } + + [AttributeUsage(AttributeTargets.Property)] + public class OriginAttribute : Attribute + { + public PropertyOrigin Origin { get; } + + public OriginAttribute(PropertyOrigin origin) + { + Origin = origin; + } + } + + public enum PropertyOrigin + { + // Note: Order is significant + Inherited = 0, + Owned, + Inlined + } + + [AttributeUsage(AttributeTargets.Property)] + public class FormatTableAttribute : Attribute + { + public int Index { get; set; } = -1; + public bool HasIndex => Index != -1; + public string Label { get; set; } + public int Width { get; set; } = -1; + public bool HasWidth => Width != -1; + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/cost-management/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..b466cc9763b6 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/PsExtensions.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal static class PsExtensions + { + // https://stackoverflow.com/a/863944/294804 + // https://stackoverflow.com/a/4452598/294804 + // https://stackoverflow.com/a/28701974/294804 + // Note: This will unwrap nested collections, but we don't generate nested collections. + public static Type Unwrap(this Type type) + { + if (type.IsArray) + { + return type.GetElementType().Unwrap(); + } + + var typeInfo = type.GetTypeInfo(); + if (typeInfo.IsGenericType + && (typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>) || typeof(IEnumerable<>).IsAssignableFrom(type))) + { + return typeInfo.GetGenericArguments().First().Unwrap(); + } + + return type; + } + + // https://stackoverflow.com/a/863944/294804 + private static bool IsSimple(this Type type) + { + var typeInfo = type.GetTypeInfo(); + return typeInfo.IsPrimitive + || typeInfo.IsEnum + || type == typeof(string) + || type == typeof(decimal); + } + + // https://stackoverflow.com/a/32025393/294804 + private static bool HasImplicitConversion(this Type baseType, Type targetType) => + baseType.GetMethods(BindingFlags.Public | BindingFlags.Static) + .Where(mi => mi.Name == "op_Implicit" && mi.ReturnType == targetType) + .Any(mi => mi.GetParameters().FirstOrDefault()?.ParameterType == baseType); + + public static bool IsPsSimple(this Type type) + { + var unwrappedType = type.Unwrap(); + return unwrappedType.IsSimple() + || unwrappedType == typeof(SwitchParameter) + || unwrappedType == typeof(Hashtable) + || unwrappedType == typeof(PSCredential) + || unwrappedType == typeof(ScriptBlock) + || unwrappedType == typeof(DateTime) + || unwrappedType == typeof(Uri) + || unwrappedType.HasImplicitConversion(typeof(string)); + } + + public static string ToPsList(this IEnumerable items) => String.Join(", ", items.Select(i => $"'{i}'")); + + public static IEnumerable ToAliasNames(this IEnumerable attributes) => attributes.OfType().SelectMany(aa => aa.AliasNames).Distinct(); + + public static bool IsArrayAndElementTypeIsT(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return itemType.IsArray && !tType.IsArray && tType.IsAssignableFrom(itemType.GetElementType()); + } + + public static bool IsTArrayAndElementTypeIsItem(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return !itemType.IsArray && tType.IsArray && (tType.GetElementType()?.IsAssignableFrom(itemType) ?? false); + } + + public static bool IsTypeOrArrayOfType(this object item) => item is T || item.IsArrayAndElementTypeIsT() || item.IsTArrayAndElementTypeIsItem(); + + public static T NormalizeArrayType(this object item) + { + if (item is T result) + { + return result; + } + + if (item.IsArrayAndElementTypeIsT()) + { + var array = (T[])Convert.ChangeType(item, typeof(T[])); + return array.FirstOrDefault(); + } + + if (item.IsTArrayAndElementTypeIsItem()) + { + var tType = typeof(T); + var array = Array.CreateInstance(tType.GetElementType(), 1); + array.SetValue(item, 0); + return (T)Convert.ChangeType(array, tType); + } + + return default(T); + } + + public static T GetNestedProperty(this PSObject psObject, params string[] names) => psObject.Properties.GetNestedProperty(names); + + public static T GetNestedProperty(this PSMemberInfoCollection properties, params string[] names) + { + var lastName = names.Last(); + var nestedProperties = names.Take(names.Length - 1).Aggregate(properties, (p, n) => p?.GetProperty(n)?.Properties); + return nestedProperties != null ? nestedProperties.GetProperty(lastName) : default(T); + } + + public static T GetProperty(this PSObject psObject, string name) => psObject.Properties.GetProperty(name); + + public static T GetProperty(this PSMemberInfoCollection properties, string name) + { + switch (properties[name]?.Value) + { + case PSObject psObject when psObject.BaseObject is PSCustomObject && psObject.ImmediateBaseObject.IsTypeOrArrayOfType(): + return psObject.ImmediateBaseObject.NormalizeArrayType(); + case PSObject psObject when psObject.BaseObject.IsTypeOrArrayOfType(): + return psObject.BaseObject.NormalizeArrayType(); + case object value when value.IsTypeOrArrayOfType(): + return value.NormalizeArrayType(); + default: + return default(T); + } + } + + public static IEnumerable RunScript(this PSCmdlet cmdlet, string script) + => PsHelpers.RunScript(cmdlet.InvokeCommand, script); + + public static void RunScript(this PSCmdlet cmdlet, string script) + => cmdlet.RunScript(script); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, string script) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, script); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, string script) + => engineIntrinsics.RunScript(script); + + public static IEnumerable RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => PsHelpers.RunScript(cmdlet.InvokeCommand, block.ToString()); + + public static void RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => cmdlet.RunScript(block.ToString()); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, block.ToString()); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => engineIntrinsics.RunScript(block.ToString()); + + /// + /// Returns if a parameter should be hidden by checking for . + /// + /// A PowerShell parameter. + public static bool IsHidden(this Parameter parameter) + { + return parameter.Attributes.Any(attr => attr is DoNotExportAttribute); + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/cost-management/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..f9986c9f4dda --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/PsHelpers.cs @@ -0,0 +1,105 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using Pwsh = System.Management.Automation.PowerShell; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal static class PsHelpers + { + public static IEnumerable RunScript(string script) + => Pwsh.Create().AddScript(script).Invoke(); + + public static void RunScript(string script) + => RunScript(script); + + public static IEnumerable RunScript(CommandInvocationIntrinsics cii, string script) + => cii.InvokeScript(script).Select(o => o?.BaseObject).Where(o => o != null).OfType(); + + public static void RunScript(CommandInvocationIntrinsics cii, string script) + => RunScript(cii, script); + + public static IEnumerable GetModuleCmdlets(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletsCommand = String.Join(" + ", modulePaths.Select(mp => $"(Get-Command -Module (Import-Module '{mp}' -PassThru))")); + return (cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand)) + .Where(ci => ci.CommandType != CommandTypes.Alias); + } + + public static IEnumerable GetModuleCmdlets(params string[] modulePaths) + => GetModuleCmdlets(null, modulePaths); + + public static IEnumerable GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder) + { + // https://stackoverflow.com/a/40969712/294804 + var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'"; + var getCmdletsCommand = $@" +$currentFunctions = Get-ChildItem function: +Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} +"; + return cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand); + } + + public static IEnumerable GetScriptCmdlets(string scriptFolder) + => GetScriptCmdlets(null, scriptFolder); + + public static IEnumerable GetScriptHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var importModules = String.Join(Environment.NewLine, modulePaths.Select(mp => $"Import-Module '{mp}'")); + var getHelpCommand = $@" +$currentFunctions = Get-ChildItem function: +{importModules} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} | ForEach-Object {{ Get-Help -Name $_.Name -Full }} +"; + return cmdlet?.RunScript(getHelpCommand) ?? RunScript(getHelpCommand); + } + + public static IEnumerable GetScriptHelpInfo(params string[] modulePaths) + => GetScriptHelpInfo(null, modulePaths); + + public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + 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)) + .Select(h => new CmdletAndHelpInfo { CommandInfo = (h["CommandInfo"] as PSObject)?.BaseObject as CommandInfo, HelpInfo = h["HelpInfo"] as PSObject }); + } + + public static IEnumerable GetModuleCmdletsAndHelpInfo(params string[] modulePaths) + => GetModuleCmdletsAndHelpInfo(null, modulePaths); + + public static CmdletAndHelpInfo ToCmdletAndHelpInfo(this CommandInfo commandInfo, PSObject helpInfo) => new CmdletAndHelpInfo { CommandInfo = commandInfo, HelpInfo = helpInfo }; + + public const string Psd1Indent = " "; + public const string GuidStart = Psd1Indent + "GUID"; + + public static Guid ReadGuidFromPsd1(string psd1Path) + { + var guid = Guid.NewGuid(); + if (File.Exists(psd1Path)) + { + var currentGuid = File.ReadAllLines(psd1Path) + .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .LastOrDefault()?.Replace("'", String.Empty); + guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; + } + + return guid; + } + } + + internal class CmdletAndHelpInfo + { + public CommandInfo CommandInfo { get; set; } + public PSObject HelpInfo { get; set; } + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/cost-management/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..9cf6c4069e86 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/StringExtensions.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal static class StringExtensions + { + public static string NullIfEmpty(this string text) => String.IsNullOrEmpty(text) ? null : text; + public static string NullIfWhiteSpace(this string text) => String.IsNullOrWhiteSpace(text) ? null : text; + public static string EmptyIfNull(this string text) => text ?? String.Empty; + + public static bool? ToNullableBool(this string text) => String.IsNullOrEmpty(text) ? (bool?)null : Convert.ToBoolean(text.ToLowerInvariant()); + + public static string ToUpperFirstCharacter(this string text) => String.IsNullOrEmpty(text) ? text : $"{text[0].ToString().ToUpperInvariant()}{text.Remove(0, 1)}"; + + public static string ReplaceNewLines(this string value, string replacer = " ", string[] newLineSymbols = null) + => (newLineSymbols ?? new []{ "\r\n", "\n" }).Aggregate(value.EmptyIfNull(), (current, symbol) => current.Replace(symbol, replacer)); + public static string NormalizeNewLines(this string value) => value.ReplaceNewLines("\u00A0").Replace("\u00A0", Environment.NewLine); + } +} diff --git a/swaggerci/cost-management/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/cost-management/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..5c3624ba39f1 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/BuildTime/XmlExtensions.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal static class XmlExtensions + { + public static string ToXmlString(this T inputObject, bool excludeDeclaration = false) + { + var serializer = new XmlSerializer(typeof(T)); + //https://stackoverflow.com/a/760290/294804 + //https://stackoverflow.com/a/3732234/294804 + var namespaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty }); + var xmlSettings = new XmlWriterSettings { OmitXmlDeclaration = excludeDeclaration, Indent = true }; + using (var stringWriter = new StringWriter()) + using (var xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + serializer.Serialize(xmlWriter, inputObject, namespaces); + return stringWriter.ToString(); + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/CmdInfoHandler.cs b/swaggerci/cost-management/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..cd9a9aaaad2b --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/CmdInfoHandler.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Management.Automation; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime +{ + using NextDelegate = Func, Task>, Task>; + using SignalDelegate = Func, Task>; + + public class CmdInfoHandler + { + private readonly string processRecordId; + private readonly string parameterSetName; + private readonly InvocationInfo invocationInfo; + + public CmdInfoHandler(string processRecordId, InvocationInfo invocationInfo, string parameterSetName) + { + this.processRecordId = processRecordId; + this.parameterSetName = parameterSetName; + this.invocationInfo = invocationInfo; + } + + public Task SendAsync(HttpRequestMessage request, CancellationToken token, Action cancel, SignalDelegate signal, NextDelegate next) + { + request.Headers.Add("x-ms-client-request-id", processRecordId); + request.Headers.Add("CommandName", invocationInfo?.InvocationName); + request.Headers.Add("FullCommandName", invocationInfo?.MyCommand?.Name); + request.Headers.Add("ParameterSetName", parameterSetName); + + // continue with pipeline. + return next(request, token, cancel, signal); + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/Conversions/ConversionException.cs b/swaggerci/cost-management/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..b0b9602e3e25 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/ConversionException.cs @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal class ConversionException : Exception + { + internal ConversionException(string message) + : base(message) { } + + internal ConversionException(JsonNode node, Type targetType) + : base($"Cannot convert '{node.Type}' to a {targetType.Name}") { } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..440232efc709 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/IJsonConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..eeb31546f543 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/BinaryConverter.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class BinaryConverter : JsonConverter + { + internal override JsonNode ToJson(byte[] value) => new XBinary(value); + + internal override byte[] FromJson(JsonNode node) + { + switch (node.Type) + { + case JsonType.String : return Convert.FromBase64String(node.ToString()); // Base64 Encoded + case JsonType.Binary : return ((XBinary)node).Value; + } + + throw new ConversionException(node, typeof(byte[])); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..f832fffd9520 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/BooleanConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class BooleanConverter : JsonConverter + { + internal override JsonNode ToJson(bool value) => new JsonBoolean(value); + + internal override bool FromJson(JsonNode node) => (bool)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..b716466fac50 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/DateTimeConverter.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class DateTimeConverter : JsonConverter + { + internal override JsonNode ToJson(DateTime value) + { + return new JsonDate(value); + } + + internal override DateTime FromJson(JsonNode node) => (DateTime)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..daa69b17df73 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class DateTimeOffsetConverter : JsonConverter + { + internal override JsonNode ToJson(DateTimeOffset value) => new JsonDate(value); + + internal override DateTimeOffset FromJson(JsonNode node) => (DateTimeOffset)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..ec50d7abc050 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/DecimalConverter.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class DecimalConverter : JsonConverter + { + internal override JsonNode ToJson(decimal value) => new JsonNumber(value.ToString()); + + internal override decimal FromJson(JsonNode node) + { + return (decimal)node; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..67488dad42c2 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/DoubleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class DoubleConverter : JsonConverter + { + internal override JsonNode ToJson(double value) => new JsonNumber(value); + + internal override double FromJson(JsonNode node) => (double)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..8474e8f9db2a --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/EnumConverter.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. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class EnumConverter : IJsonConverter + { + private readonly Type type; + + internal EnumConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + } + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + + public object FromJson(JsonNode node) + { + if (node.Type == JsonType.Number) + { + return Enum.ToObject(type, (int)node); + } + + return Enum.Parse(type, node.ToString(), ignoreCase: true); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..2911b0c9394c --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/GuidConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class GuidConverter : JsonConverter + { + internal override JsonNode ToJson(Guid value) => new JsonString(value.ToString()); + + internal override Guid FromJson(JsonNode node) => (Guid)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..668ba7fd581b --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/HashSet'1Converter.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class HashSetConverter : JsonConverter> + { + internal override JsonNode ToJson(HashSet value) + { + return new XSet(value); + } + + internal override HashSet FromJson(JsonNode node) + { + var collection = node as ICollection; + + if (collection.Count == 0) return null; + + // TODO: Remove Linq depedency + return new HashSet(collection.Cast()); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..b492775c3714 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/Int16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class Int16Converter : JsonConverter + { + internal override JsonNode ToJson(short value) => new JsonNumber(value); + + internal override short FromJson(JsonNode node) => (short)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..298ce57af0bf --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/Int32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class Int32Converter : JsonConverter + { + internal override JsonNode ToJson(int value) => new JsonNumber(value); + + internal override int FromJson(JsonNode node) => (int)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..e4bc6ec96818 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/Int64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class Int64Converter : JsonConverter + { + internal override JsonNode ToJson(long value) => new JsonNumber(value); + + internal override long FromJson(JsonNode node) => (long)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..7018083a0310 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/JsonArrayConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class JsonArrayConverter : JsonConverter + { + internal override JsonNode ToJson(JsonArray value) => value; + + internal override JsonArray FromJson(JsonNode node) => (JsonArray)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..c820ba5b528b --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/JsonObjectConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class JsonObjectConverter : JsonConverter + { + internal override JsonNode ToJson(JsonObject value) => value; + + internal override JsonObject FromJson(JsonNode node) => (JsonObject)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..8a718b2494d8 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/SingleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class SingleConverter : JsonConverter + { + internal override JsonNode ToJson(float value) => new JsonNumber(value.ToString()); + + internal override float FromJson(JsonNode node) => (float)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..58d8e43e5b6d --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/StringConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class StringConverter : JsonConverter + { + internal override JsonNode ToJson(string value) => new JsonString(value); + + internal override string FromJson(JsonNode node) => node.ToString(); + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..f79566b7f9a5 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/TimeSpanConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class TimeSpanConverter : JsonConverter + { + internal override JsonNode ToJson(TimeSpan value) => new JsonString(value.ToString()); + + internal override TimeSpan FromJson(JsonNode node) => (TimeSpan)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..e734b8841da7 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/UInt16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class UInt16Converter : JsonConverter + { + internal override JsonNode ToJson(ushort value) => new JsonNumber(value); + + internal override ushort FromJson(JsonNode node) => (ushort)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..5470b3c5cee0 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/UInt32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class UInt32Converter : JsonConverter + { + internal override JsonNode ToJson(uint value) => new JsonNumber(value); + + internal override uint FromJson(JsonNode node) => (uint)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..38765e888def --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/UInt64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class UInt64Converter : JsonConverter + { + internal override JsonNode ToJson(ulong value) => new JsonNumber(value.ToString()); + + internal override ulong FromJson(JsonNode node) => (ulong)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..f1f670347654 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/Instances/UriConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class UriConverter : JsonConverter + { + internal override JsonNode ToJson(Uri value) => new JsonString(value.AbsoluteUri); + + internal override Uri FromJson(JsonNode node) => (Uri)node; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..9a246f0b1b50 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/JsonConverter.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public abstract class JsonConverter : IJsonConverter + { + internal abstract T FromJson(JsonNode node); + + internal abstract JsonNode ToJson(T value); + + #region IConverter + + object IJsonConverter.FromJson(JsonNode node) => FromJson(node); + + JsonNode IJsonConverter.ToJson(object value) => ToJson((T)value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/cost-management/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..4b9b60091b7c --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/JsonConverterAttribute.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class JsonConverterAttribute : Attribute + { + internal JsonConverterAttribute(Type type) + { + Converter = (IJsonConverter)Activator.CreateInstance(type); + } + + internal IJsonConverter Converter { get; } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/cost-management/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..da52c87d0bb6 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/JsonConverterFactory.cs @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public sealed class JsonConverterFactory + { + private static readonly Dictionary converters = new Dictionary(); + + static JsonConverterFactory() + { + AddInternal(new BooleanConverter()); + AddInternal(new DateTimeConverter()); + AddInternal(new DateTimeOffsetConverter()); + AddInternal(new BinaryConverter()); + AddInternal(new DecimalConverter()); + AddInternal(new DoubleConverter()); + AddInternal(new GuidConverter()); + AddInternal(new Int16Converter()); + AddInternal(new Int32Converter()); + AddInternal(new Int64Converter()); + AddInternal(new SingleConverter()); + AddInternal(new StringConverter()); + AddInternal(new TimeSpanConverter()); + AddInternal(new UInt16Converter()); + AddInternal(new UInt32Converter()); + AddInternal(new UInt64Converter()); + AddInternal(new UriConverter()); + + // Hash sets + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + + // JSON + + AddInternal(new JsonObjectConverter()); + AddInternal(new JsonArrayConverter()); + } + + internal static Dictionary Instances => converters; + + internal static IJsonConverter Get(Type type) + { + var details = TypeDetails.Get(type); + + if (details.JsonConverter == null) + { + throw new ConversionException($"No converter found for '{type.Name}'."); + } + + return details.JsonConverter; + } + + internal static bool TryGet(Type type, out IJsonConverter converter) + { + var typeDetails = TypeDetails.Get(type); + + converter = typeDetails.JsonConverter; + + return converter != null; + } + + private static void AddInternal(JsonConverter converter) + => converters.Add(typeof(T), converter); + + private static void AddInternal(IJsonConverter converter) + => converters.Add(typeof(T), converter); + + internal static void Add(JsonConverter converter) + { + if (converter == null) + { + throw new ArgumentNullException(nameof(converter)); + } + + AddInternal(converter); + + var type = TypeDetails.Get(); + + type.JsonConverter = converter; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/cost-management/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..43b25e5cafa4 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Conversions/StringLikeConverter.cs @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class StringLikeConverter : IJsonConverter + { + private readonly Type type; + private readonly MethodInfo parseMethod; + + internal StringLikeConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + this.parseMethod = StringLikeHelper.GetParseMethod(type); + } + + public object FromJson(JsonNode node) => + parseMethod.Invoke(null, new[] { node.ToString() }); + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + } + + internal static class StringLikeHelper + { + private static readonly Type[] parseMethodParamaterTypes = new[] { typeof(string) }; + + internal static bool IsStringLike(Type type) + { + return GetParseMethod(type) != null; + } + + internal static MethodInfo GetParseMethod(Type type) + { + MethodInfo method = type.GetMethod("Parse", parseMethodParamaterTypes); + + if (method?.IsPublic != true) return null; + + return method; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/cost-management/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..9d2f65b4d3ca --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Customizations/IJsonSerializable.cs @@ -0,0 +1,263 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime +{ + public interface IJsonSerializable + { + JsonNode ToJson(JsonObject container = null, SerializationMode serializationMode = SerializationMode.None); + } + internal static class JsonSerializable + { + /// + /// Serializes an enumerable and returns a JsonNode. + /// + /// an IEnumerable collection of items + /// A JsonNode that contains the collection of items serialized. + private static JsonNode ToJsonValue(System.Collections.IEnumerable enumerable) + { + if (enumerable != null) + { + // is it a byte array of some kind? + if (enumerable is System.Collections.Generic.IEnumerable byteEnumerable) + { + return new XBinary(System.Linq.Enumerable.ToArray(byteEnumerable)); + } + + var hasValues = false; + // just create an array of value nodes. + var result = new XNodeArray(); + foreach (var each in enumerable) + { + // we had at least one value. + hasValues = true; + + // try to serialize it. + var node = ToJsonValue(each); + if (null != node) + { + result.Add(node); + } + } + + // if we were able to add values, (or it was just empty), return it. + if (result.Count > 0 || !hasValues) + { + return result; + } + } + + // we couldn't serialize the values. Sorry. + return null; + } + + /// + /// Serializes a valuetype to a JsonNode. + /// + /// a ValueType (ie, a primitive, enum or struct) to be serialized + /// a JsonNode with the serialized value + private static JsonNode ToJsonValue(ValueType vValue) + { + // numeric type + if (vValue is SByte || vValue is Int16 || vValue is Int32 || vValue is Int64 || vValue is Byte || vValue is UInt16 || vValue is UInt32 || vValue is UInt64 || vValue is decimal || vValue is float || vValue is double) + { + return new JsonNumber(vValue.ToString()); + } + + // boolean type + if (vValue is bool bValue) + { + return new JsonBoolean(bValue); + } + + // dates + if (vValue is DateTime dtValue) + { + return new JsonDate(dtValue); + } + + // DictionaryEntity struct type + if (vValue is System.Collections.DictionaryEntry deValue) + { + return new JsonObject { { deValue.Key.ToString(), ToJsonValue(deValue.Value) } }; + } + + // sorry, no idea. + return null; + } + /// + /// Attempts to serialize an object by using ToJson() or ToJsonString() if they exist. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + private static JsonNode TryToJsonValue(dynamic oValue) + { + object jsonValue = null; + dynamic v = oValue; + try + { + jsonValue = v.ToJson().ToString(); + } + catch + { + // no harm... + try + { + jsonValue = v.ToJsonString().ToString(); + } + catch + { + // no worries here either. + } + } + + // if we got something out, let's use it. + if (null != jsonValue) + { + // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok? + return new JsonNumber(jsonValue.ToString()); + } + + return null; + } + + /// + /// Serialize an object by using a variety of methods. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + internal static JsonNode ToJsonValue(object value) + { + // things that implement our interface are preferred. + if (value is Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IJsonSerializable jsonSerializable) + { + return jsonSerializable.ToJson(); + } + + // strings are easy. + if (value is string || value is char) + { + return new JsonString(value.ToString()); + } + + // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString ) + if (value is System.ValueType vValue) + { + return ToJsonValue(vValue) ?? TryToJsonValue(vValue) ?? new JsonString(vValue.ToString()); + } + + // dictionaries are objects that should be able to serialize + if (value is System.Collections.Generic.IDictionary dictionary) + { + return Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.ToJson(dictionary, null); + } + + // hashtables are converted to dictionaries for serialization + if (value is System.Collections.Hashtable hashtable) + { + var dict = new System.Collections.Generic.Dictionary(); + DictionaryExtensions.HashTableToDictionary(hashtable, dict); + return Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.ToJson(dict, null); + } + + // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString) + if (value is System.Collections.IEnumerable enumerableValue) + { + // some kind of enumerable value + return ToJsonValue(enumerableValue) ?? TryToJsonValue(value) ?? new JsonString(value.ToString()); + } + + // at this point, we're going to fallback to a string literal here, since we really have no idea what it is. + return new JsonString(value.ToString()); + } + + internal static JsonObject ToJson(System.Collections.Generic.Dictionary dictionary, JsonObject container) => ToJson((System.Collections.Generic.IDictionary)dictionary, container); + + /// + /// Serializes a dictionary into a JsonObject container. + /// + /// The dictionary to serailize + /// the container to serialize the dictionary into + /// the container + internal static JsonObject ToJson(System.Collections.Generic.IDictionary dictionary, JsonObject container) + { + container = container ?? new JsonObject(); + if (dictionary != null && dictionary.Count > 0) + { + foreach (var key in dictionary) + { + // currently, we don't serialize null values. + if (null != key.Value) + { + container.Add(key.Key, ToJsonValue(key.Value)); + continue; + } + } + } + return container; + } + + internal static Func> DeserializeDictionary(Func> dictionaryFactory) + { + return (node) => FromJson(node, dictionaryFactory(), (object)(DeserializeDictionary(dictionaryFactory)) as Func); + } + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.Dictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) => FromJson(json, (System.Collections.Generic.IDictionary)container, objectFactory, excludes); + + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.IDictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) + { + if (null == json) + { + return container; + } + + foreach (var key in json.Keys) + { + if (true == excludes?.Contains(key)) + { + continue; + } + + var value = json[key]; + try + { + switch (value.Type) + { + case JsonType.Null: + // skip null values. + continue; + + case JsonType.Array: + case JsonType.Boolean: + case JsonType.Date: + case JsonType.Binary: + case JsonType.Number: + case JsonType.String: + container.Add(key, (V)value.ToValue()); + break; + case JsonType.Object: + if (objectFactory != null) + { + var v = objectFactory(value as JsonObject); + if (null != v) + { + container.Add(key, v); + } + } + break; + } + } + catch + { + } + } + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Customizations/JsonArray.cs b/swaggerci/cost-management/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..a5ce75e3431e --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Customizations/JsonArray.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + public partial class JsonArray + { + internal override object ToValue() => Count == 0 ? new object[0] : System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(this, each => each.ToValue())); + } + + +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/cost-management/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..70c83dd9ef00 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Customizations/JsonBoolean.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + internal partial class JsonBoolean + { + internal static JsonBoolean Create(bool? value) => value is bool b ? new JsonBoolean(b) : null; + internal bool ToBoolean() => Value; + + internal override object ToValue() => Value; + } + + +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Customizations/JsonNode.cs b/swaggerci/cost-management/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..bebfe8cd931f --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Customizations/JsonNode.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonNode + { + /// + /// Returns the content of this node as the underlying value. + /// Will default to the string representation if not overridden in child classes. + /// + /// an object with the underlying value of the node. + internal virtual object ToValue() { + return this.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/cost-management/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..b7904982feb2 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Customizations/JsonNumber.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + using System; + + public partial class JsonNumber + { + internal static readonly DateTime EpochDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static long ToUnixTime(DateTime dateTime) + { + return (long)dateTime.Subtract(EpochDate).TotalSeconds; + } + private static DateTime FromUnixTime(long totalSeconds) + { + return EpochDate.AddSeconds(totalSeconds); + } + internal byte ToByte() => this; + internal int ToInt() => this; + internal long ToLong() => this; + internal short ToShort() => this; + internal UInt16 ToUInt16() => this; + internal UInt32 ToUInt32() => this; + internal UInt64 ToUInt64() => this; + internal decimal ToDecimal() => this; + internal double ToDouble() => this; + internal float ToFloat() => this; + + internal static JsonNumber Create(int? value) => value is int n ? new JsonNumber(n) : null; + internal static JsonNumber Create(long? value) => value is long n ? new JsonNumber(n) : null; + internal static JsonNumber Create(float? value) => value is float n ? new JsonNumber(n) : null; + internal static JsonNumber Create(double? value) => value is double n ? new JsonNumber(n) : null; + internal static JsonNumber Create(decimal? value) => value is decimal n ? new JsonNumber(n) : null; + internal static JsonNumber Create(DateTime? value) => value is DateTime date ? new JsonNumber(ToUnixTime(date)) : null; + + public static implicit operator DateTime(JsonNumber number) => FromUnixTime(number); + internal DateTime ToDateTime() => this; + + internal JsonNumber(decimal value) + { + this.value = value.ToString(); + } + internal override object ToValue() + { + if (IsInteger) + { + if (int.TryParse(this.value, out int iValue)) + { + return iValue; + } + if (long.TryParse(this.value, out long lValue)) + { + return lValue; + } + } + else + { + if (float.TryParse(this.value, out float fValue)) + { + return fValue; + } + if (double.TryParse(this.value, out double dValue)) + { + return dValue; + } + if (decimal.TryParse(this.value, out decimal dcValue)) + { + return dcValue; + } + } + return null; + } + } + + +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Customizations/JsonObject.cs b/swaggerci/cost-management/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..910eef9fc203 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Customizations/JsonObject.cs @@ -0,0 +1,183 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.JsonSerializable.FromJson(this, new System.Collections.Generic.Dictionary(), (obj) => obj.ToValue()); + + internal void SafeAdd(string name, Func valueFn) + { + if (valueFn != null) + { + var value = valueFn(); + if (null != value) + { + items.Add(name, value); + } + } + } + + internal void SafeAdd(string name, JsonNode value) + { + if (null != value) + { + items.Add(name, value); + } + } + + internal T NullableProperty(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; + } + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + //throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal JsonObject Property(string propertyName) + { + return PropertyT(propertyName); + } + + internal T PropertyT(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; // we're going to assume that the consumer knows what to do if null is explicity returned? + } + + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + // throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal int NumberProperty(string propertyName, ref int output) => output = this.PropertyT(propertyName)?.ToInt() ?? output; + internal float NumberProperty(string propertyName, ref float output) => output = this.PropertyT(propertyName)?.ToFloat() ?? output; + internal byte NumberProperty(string propertyName, ref byte output) => output = this.PropertyT(propertyName)?.ToByte() ?? output; + internal long NumberProperty(string propertyName, ref long output) => output = this.PropertyT(propertyName)?.ToLong() ?? output; + internal double NumberProperty(string propertyName, ref double output) => output = this.PropertyT(propertyName)?.ToDouble() ?? output; + internal decimal NumberProperty(string propertyName, ref decimal output) => output = this.PropertyT(propertyName)?.ToDecimal() ?? output; + internal short NumberProperty(string propertyName, ref short output) => output = this.PropertyT(propertyName)?.ToShort() ?? output; + internal DateTime NumberProperty(string propertyName, ref DateTime output) => output = this.PropertyT(propertyName)?.ToDateTime() ?? output; + + internal int? NumberProperty(string propertyName, ref int? output) => output = this.NullableProperty(propertyName)?.ToInt() ?? null; + internal float? NumberProperty(string propertyName, ref float? output) => output = this.NullableProperty(propertyName)?.ToFloat() ?? null; + internal byte? NumberProperty(string propertyName, ref byte? output) => output = this.NullableProperty(propertyName)?.ToByte() ?? null; + internal long? NumberProperty(string propertyName, ref long? output) => output = this.NullableProperty(propertyName)?.ToLong() ?? null; + internal double? NumberProperty(string propertyName, ref double? output) => output = this.NullableProperty(propertyName)?.ToDouble() ?? null; + internal decimal? NumberProperty(string propertyName, ref decimal? output) => output = this.NullableProperty(propertyName)?.ToDecimal() ?? null; + internal short? NumberProperty(string propertyName, ref short? output) => output = this.NullableProperty(propertyName)?.ToShort() ?? null; + + internal DateTime? NumberProperty(string propertyName, ref DateTime? output) => output = this.NullableProperty(propertyName)?.ToDateTime() ?? null; + + + internal string StringProperty(string propertyName) => this.PropertyT(propertyName)?.ToString(); + internal string StringProperty(string propertyName, ref string output) => output = this.PropertyT(propertyName)?.ToString() ?? output; + internal char StringProperty(string propertyName, ref char output) => output = this.PropertyT(propertyName)?.ToChar() ?? output; + internal char? StringProperty(string propertyName, ref char? output) => output = this.PropertyT(propertyName)?.ToChar() ?? null; + + internal DateTime StringProperty(string propertyName, ref DateTime output) => DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out output) ? output : output; + internal DateTime? StringProperty(string propertyName, ref DateTime? output) => output = DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out var o) ? o : output; + + + internal bool BooleanProperty(string propertyName, ref bool output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? output; + internal bool? BooleanProperty(string propertyName, ref bool? output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? null; + + internal T[] ArrayProperty(string propertyName, ref T[] output, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + } + return output; + } + internal T[] ArrayProperty(string propertyName, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + var output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + return output; + } + return new T[0]; + } + internal void IterateArrayProperty(string propertyName, Action deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + for (var i = 0; i < array.Count; i++) + { + deserializer(array[i]); + } + } + } + + internal Dictionary DictionaryProperty(string propertyName, ref Dictionary output, Func deserializer) + { + var dictionary = this.PropertyT(propertyName); + if (output == null) + { + output = new Dictionary(); + } + else + { + output.Clear(); + } + if (dictionary != null) + { + foreach (var key in dictionary.Keys) + { + output[key] = deserializer(dictionary[key]); + } + } + return output; + } + + internal static JsonObject Create(IDictionary source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new JsonObject(); + + foreach (var key in source.Keys) + { + result.SafeAdd(key, selector(source[key])); + } + return result; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Customizations/JsonString.cs b/swaggerci/cost-management/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..576ca7668d73 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Customizations/JsonString.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + using System; + using System.Globalization; + using System.Linq; + + public partial class JsonString + { + internal static string DateFormat = "yyyy-MM-dd"; + internal static string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; + internal static string DateTimeRfc1123Format = "R"; + + internal static JsonString Create(string value) => value == null ? null : new JsonString(value); + internal static JsonString Create(char? value) => value is char c ? new JsonString(c.ToString()) : null; + + internal static JsonString CreateDate(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTime(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTimeRfc1123(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeRfc1123Format, CultureInfo.CurrentCulture)) : null; + + internal char ToChar() => this.Value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char(JsonString value) => value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char? (JsonString value) => value?.ToString()?.FirstOrDefault(); + + public static implicit operator DateTime(JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime); + public static implicit operator DateTime? (JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime?); + + } + + +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/cost-management/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..d30f83325bef --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Customizations/XNodeArray.cs @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + using System; + using System.Linq; + + public partial class XNodeArray + { + internal static XNodeArray Create(T[] source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new XNodeArray(); + foreach (var item in source.Select(selector)) + { + result.SafeAdd(item); + } + return result; + } + internal void SafeAdd(JsonNode item) + { + if (item != null) + { + items.Add(item); + } + } + internal void SafeAdd(Func itemFn) + { + if (itemFn != null) + { + var item = itemFn(); + if (item != null) + { + items.Add(item); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Debugging.cs b/swaggerci/cost-management/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..3e8564fdf62d --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Debugging.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + internal static class AttachDebugger + { + internal static void Break() + { + while (!System.Diagnostics.Debugger.IsAttached) + { + System.Console.Error.WriteLine($"Waiting for debugger to attach to process {System.Diagnostics.Process.GetCurrentProcess().Id}"); + for (int i = 0; i < 50; i++) + { + if (System.Diagnostics.Debugger.IsAttached) + { + break; + } + System.Threading.Thread.Sleep(100); + System.Console.Error.Write("."); + } + System.Console.Error.WriteLine(); + } + System.Diagnostics.Debugger.Break(); + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/DictionaryExtensions.cs b/swaggerci/cost-management/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..270e281faba3 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/DictionaryExtensions.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.Cost.Runtime +{ + internal static class DictionaryExtensions + { + internal static void HashTableToDictionary(System.Collections.Hashtable hashtable, System.Collections.Generic.IDictionary dictionary) + { + if (null == hashtable) + { + return; + } + foreach (var each in hashtable.Keys) + { + var key = each.ToString(); + var value = hashtable[key]; + if (null != value) + { + try + { + dictionary[key] = (V)value; + } + catch + { + // Values getting dropped; not compatible with target dictionary. Not sure what to do here. + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/EventData.cs b/swaggerci/cost-management/generated/runtime/EventData.cs new file mode 100644 index 000000000000..cf65700bd07f --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/EventData.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + + using System; + using System.Threading; + + ///Represents the data in signaled event. + public partial class EventData + { + /// + /// The type of the event being signaled + /// + public string Id; + + /// + /// The user-ready message from the event. + /// + public string Message; + + /// + /// When the event is about a parameter, this is the parameter name. + /// Used in Validation Events + /// + public string Parameter; + + /// + /// This represents a numeric value associated with the event. + /// Use for progress-style events + /// + public double Value; + + /// + /// Any extended data for an event should be serialized and stored here. + /// + public string ExtendedData; + + /// + /// If the event triggers after the request message has been created, this will contain the Request Message (which in HTTP calls would be HttpRequestMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.RequestMessgae is HttpRequestMessage httpRequest) + /// { + /// httpRequest.Headers.Add("x-request-flavor", "vanilla"); + /// } + /// + /// + public object RequestMessage; + + /// + /// If the event triggers after the response is back, this will contain the Response Message (which in HTTP calls would be HttpResponseMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.ResponseMessage is HttpResponseMessage httpResponse){ + /// var flavor = httpResponse.Headers.GetValue("x-request-flavor"); + /// } + /// + /// + public object ResponseMessage; + + /// + /// Cancellation method for this event. + /// + /// If the event consumer wishes to cancel the request that initiated this event, call Cancel() + /// + /// + /// The original initiator of the request must provide the implementation of this. + /// + public System.Action Cancel; + } + +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/EventDataExtensions.cs b/swaggerci/cost-management/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..672bec774e6b --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/EventDataExtensions.cs @@ -0,0 +1,94 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using System; + + /// + /// PowerShell-specific data on top of the llc# EventData + /// + /// + /// In PowerShell, we add on the EventDataConverter to support sending events between modules. + /// Obviously, this code would need to be duplcated on both modules. + /// This is preferable to sharing a common library, as versioning makes that problematic. + /// + [System.ComponentModel.TypeConverter(typeof(EventDataConverter))] + public partial class EventData : EventArgs + { + } + + /// + /// A PowerShell PSTypeConverter to adapt an EventData object that has been passed. + /// Usually used between modules. + /// + public class EventDataConverter : System.Management.Automation.PSTypeConverter + { + public override bool CanConvertTo(object sourceValue, Type destinationType) => false; + public override object ConvertTo(object sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => null; + public override bool CanConvertFrom(dynamic sourceValue, Type destinationType) => destinationType == typeof(EventData) && CanConvertFrom(sourceValue); + public override object ConvertFrom(dynamic sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Verifies that a given object has the required members to convert it to the target type (EventData) + /// + /// Uses a dynamic type so that it is able to use the simplest code without excessive checking. + /// + /// The instance to verify + /// True, if the object has all the required parameters. + public static bool CanConvertFrom(dynamic sourceValue) + { + try + { + // check if this has *required* parameters... + sourceValue?.Id?.GetType(); + sourceValue?.Message?.GetType(); + sourceValue?.Cancel?.GetType(); + + // remaining parameters are not *required*, + // and if they have values, it will copy them at conversion time. + } + catch + { + // if anything throws an exception (because it's null, or doesn't have that member) + return false; + } + return true; + } + + /// + /// Returns result of the delegate as the expected type, or default(T) + /// + /// This isolates any exceptions from the consumer. + /// + /// A delegate that returns a value + /// The desired output type + /// The value from the function if the type is correct + private static T To(Func srcValue) + { + try { return srcValue(); } + catch { return default(T); } + } + + /// + /// Converts an incoming object to the expected type by treating the incoming object as a dynamic, and coping the expected values. + /// + /// the incoming object + /// EventData + public static EventData ConvertFrom(dynamic sourceValue) + { + return new EventData + { + Id = To(() => sourceValue.Id), + Message = To(() => sourceValue.Message), + Parameter = To(() => sourceValue.Parameter), + Value = To(() => sourceValue.Value), + RequestMessage = To(() => sourceValue.RequestMessage), + ResponseMessage = To(() => sourceValue.ResponseMessage), + Cancel = To(() => sourceValue.Cancel) + }; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/EventListener.cs b/swaggerci/cost-management/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..26112cc41022 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/EventListener.cs @@ -0,0 +1,247 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.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.Cost.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IEventListener listener); + } + + /// + /// The IEventListener Interface defines the communication mechanism for Signaling events during a remote call. + /// + /// + /// The interface is designed to be as minimal as possible, allow for quick peeking of the event type (id) + /// and the cancellation status and provides a delegate for retrieving the event details themselves. + /// + public interface IEventListener + { + Task Signal(string id, CancellationToken token, GetEventData createMessage); + CancellationToken Token { get; } + System.Action Cancel { get; } + } + + internal static partial class Extensions + { + public static Task Signal(this IEventListener instance, string id, CancellationToken token, Func createMessage) => instance.Signal(id, token, createMessage); + public static Task Signal(this IEventListener instance, string id, CancellationToken token) => instance.Signal(id, token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, EventData message) => instance.Signal(id, token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, Func createMessage) => instance.Signal(id, instance.Token, createMessage); + public static Task Signal(this IEventListener instance, string id) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, EventData message) => instance.Signal(id, instance.Token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, System.Uri uri) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = uri.ToString(), Cancel = instance.Cancel }); + + public static async Task AssertNotNull(this IEventListener instance, string parameterName, object value) + { + if (value == null) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' should not be null", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMinimumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length < length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is less than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMaximumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length > length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is greater than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + + public static async Task AssertRegEx(this IEventListener instance, string parameterName, string value, string regularExpression) + { + if (value != null && !System.Text.RegularExpressions.Regex.Match(value, regularExpression).Success) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' does not validate against pattern /{regularExpression}/", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertEnum(this IEventListener instance, string parameterName, string value, params string[] values) + { + if (!values.Any(each => each.Equals(value))) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' is not one of ({values.Aggregate((c, e) => $"'{e}',{c}")}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertObjectIsValid(this IEventListener instance, string parameterName, object inst) + { + await (inst as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.IValidates)?.Validate(instance); + } + + public static async Task AssertIsLessThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) >= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) <= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsLessThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) > 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) < 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, Int64? value, Int64 multiple) + { + if (null != value && value % multiple != 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, double? value, double multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, decimal? value, decimal multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + } + + /// + /// An Implementation of the IEventListener that supports subscribing to events and dispatching them + /// (used for manually using the lowlevel interface) + /// + public class EventListener : CancellationTokenSource, IEnumerable>, IEventListener + { + private Dictionary calls = new Dictionary(); + public IEnumerator> GetEnumerator() => calls.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => calls.GetEnumerator(); + public EventListener() + { + } + + public new Action Cancel => base.Cancel; + private Event tracer; + + public EventListener(params (string name, Event callback)[] initializer) + { + foreach (var each in initializer) + { + Add(each.name, each.callback); + } + } + + public void Add(string name, SynchEvent callback) + { + Add(name, (message) => { callback(message); return Task.CompletedTask; }); + } + + public void Add(string name, Event callback) + { + if (callback != null) + { + if (string.IsNullOrEmpty(name)) + { + if (calls.ContainsKey(name)) + { + tracer += callback; + } + else + { + tracer = callback; + } + } + else + { + if (calls.ContainsKey(name)) + { + calls[name ?? System.String.Empty] += callback; + } + else + { + calls[name ?? System.String.Empty] = callback; + } + } + } + } + + + public async Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + using (NoSynchronizationContext) + { + if (!string.IsNullOrEmpty(id) && (calls.TryGetValue(id, out Event listener) || tracer != null)) + { + var message = createMessage(); + message.Id = id; + + await listener?.Invoke(message); + await tracer?.Invoke(message); + + if (token.IsCancellationRequested) + { + throw new OperationCanceledException($"Canceled by event {id} ", this.Token); + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Events.cs b/swaggerci/cost-management/generated/runtime/Events.cs new file mode 100644 index 000000000000..ef158647431e --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Events.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + public static partial class Events + { + public const string Log = nameof(Log); + public const string Validation = nameof(Validation); + public const string ValidationWarning = nameof(ValidationWarning); + public const string AfterValidation = nameof(AfterValidation); + public const string RequestCreated = nameof(RequestCreated); + public const string ResponseCreated = nameof(ResponseCreated); + public const string URLCreated = nameof(URLCreated); + public const string Finally = nameof(Finally); + public const string HeaderParametersAdded = nameof(HeaderParametersAdded); + public const string BodyContentSet = nameof(BodyContentSet); + public const string BeforeCall = nameof(BeforeCall); + public const string BeforeResponseDispatch = nameof(BeforeResponseDispatch); + public const string FollowingNextLink = nameof(FollowingNextLink); + public const string DelayBeforePolling = nameof(DelayBeforePolling); + public const string Polling = nameof(Polling); + + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/EventsExtensions.cs b/swaggerci/cost-management/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..e30ae5629a85 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/EventsExtensions.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + public static partial class Events + { + public const string CmdletProcessRecordStart = nameof(CmdletProcessRecordStart); + public const string CmdletProcessRecordAsyncStart = nameof(CmdletProcessRecordAsyncStart); + public const string CmdletException = nameof(CmdletException); + public const string CmdletGetPipeline = nameof(CmdletGetPipeline); + public const string CmdletBeforeAPICall = nameof(CmdletBeforeAPICall); + public const string CmdletBeginProcessing = nameof(CmdletBeginProcessing); + public const string CmdletEndProcessing = nameof(CmdletEndProcessing); + public const string CmdletProcessRecordEnd = nameof(CmdletProcessRecordEnd); + public const string CmdletProcessRecordAsyncEnd = nameof(CmdletProcessRecordAsyncEnd); + public const string CmdletAfterAPICall = nameof(CmdletAfterAPICall); + + public const string Verbose = nameof(Verbose); + public const string Debug = nameof(Debug); + public const string Information = nameof(Information); + public const string Error = nameof(Error); + public const string Warning = nameof(Warning); + } + +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Extensions.cs b/swaggerci/cost-management/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..10d5181dfe59 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Extensions.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using System.Linq; + using System; + + internal static partial class Extensions + { + public static T[] SubArray(this T[] array, int offset, int length) + { + return new ArraySegment(array, offset, length) + .ToArray(); + } + + public static T ReadHeaders(this T instance, global::System.Net.Http.Headers.HttpResponseHeaders headers) where T : class + { + (instance as IHeaderSerializable)?.ReadHeaders(headers); + return instance; + } + + internal static bool If(T input, out T output) + { + if (null == input) + { + output = default(T); + return false; + } + output = input; + return true; + } + + internal static void AddIf(T value, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(value); + } + } + + internal static void AddIf(T value, string serializedName, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(serializedName, value); + } + } + + /// + /// Returns the first header value as a string from an HttpReponseMessage. + /// + /// the HttpResponseMessage to fetch a header from + /// the header name + /// the first header value as a string from an HttpReponseMessage. string.empty if there is no header value matching + internal static string GetFirstHeader(this System.Net.Http.HttpResponseMessage response, string headerName) => response.Headers.FirstOrDefault(each => string.Equals(headerName, each.Key, System.StringComparison.OrdinalIgnoreCase)).Value?.FirstOrDefault() ?? string.Empty; + + /// + /// Sets the Synchronization Context to null, and returns an IDisposable that when disposed, + /// will restore the synchonization context to the original value. + /// + /// This is used a less-invasive means to ensure that code in the library that doesn't + /// need to be continued in the original context doesn't have to have ConfigureAwait(false) + /// on every single await + /// + /// If the SynchronizationContext is null when this is used, the resulting IDisposable + /// will not do anything (this prevents excessive re-setting of the SynchronizationContext) + /// + /// Usage: + /// + /// using(NoSynchronizationContext) { + /// await SomeAsyncOperation(); + /// await SomeOtherOperation(); + /// } + /// + /// + /// + /// An IDisposable that will return the SynchronizationContext to original state + internal static System.IDisposable NoSynchronizationContext => System.Threading.SynchronizationContext.Current == null ? Dummy : new NoSyncContext(); + + /// + /// An instance of the Dummy IDispoable. + /// + /// + internal static System.IDisposable Dummy = new DummyDisposable(); + + /// + /// An IDisposable that does absolutely nothing. + /// + internal class DummyDisposable : System.IDisposable + { + public void Dispose() + { + } + } + /// + /// An IDisposable that saves the SynchronizationContext,sets it to null and + /// restores it to the original upon Dispose(). + /// + /// NOTE: This is designed to be less invasive than using .ConfigureAwait(false) + /// on every single await in library code (ie, places where we know we don't need + /// to continue in the same context as we went async) + /// + internal class NoSyncContext : System.IDisposable + { + private System.Threading.SynchronizationContext original = System.Threading.SynchronizationContext.Current; + internal NoSyncContext() + { + System.Threading.SynchronizationContext.SetSynchronizationContext(null); + } + public void Dispose() => System.Threading.SynchronizationContext.SetSynchronizationContext(original); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/cost-management/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..4936f93f08f0 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal static class StringBuilderExtensions + { + /// + /// Extracts the buffered value and resets the buffer + /// + internal static string Extract(this StringBuilder builder) + { + var text = builder.ToString(); + + builder.Clear(); + + return text; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/cost-management/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..eb95f458e5da --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Helpers/Extensions/TypeExtensions.cs @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal static class TypeExtensions + { + internal static bool IsNullable(this Type type) => + type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable<>)); + + internal static Type GetOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition() == openGenericInterfaceType) + { + return candidateType; + } + + // Check if it references it's own converter.... + + foreach (Type interfaceType in candidateType.GetInterfaces()) + { + if (interfaceType.IsGenericType + && interfaceType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return interfaceType; + } + } + + return null; + } + + // Author: Sebastian Good + // http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type + internal static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + if (candidateType.Equals(openGenericInterfaceType)) + { + return true; + } + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return true; + } + + foreach (Type i in candidateType.GetInterfaces()) + { + if (i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType)) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Helpers/Seperator.cs b/swaggerci/cost-management/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..f3953c808689 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Helpers/Seperator.cs @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/cost-management/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..c6d592bdc13f --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Helpers/TypeDetails.cs @@ -0,0 +1,116 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + + + + internal class TypeDetails + { + private readonly Type info; + + internal TypeDetails(Type info) + { + this.info = info ?? throw new ArgumentNullException(nameof(info)); + } + + internal Type NonNullType { get; set; } + + internal object DefaultValue { get; set; } + + internal bool IsNullable { get; set; } + + internal bool IsList { get; set; } + + internal bool IsStringLike { get; set; } + + internal bool IsEnum => info.IsEnum; + + internal bool IsArray => info.IsArray; + + internal bool IsValueType => info.IsValueType; + + internal Type ElementType { get; set; } + + internal IJsonConverter JsonConverter { get; set; } + + #region Creation + + private static readonly ConcurrentDictionary cache = new ConcurrentDictionary(); + + internal static TypeDetails Get() => Get(typeof(T)); + + internal static TypeDetails Get(Type type) => cache.GetOrAdd(type, Create); + + private static TypeDetails Create(Type type) + { + var isGenericList = !type.IsPrimitive && type.ImplementsOpenGenericInterface(typeof(IList<>)); + var isList = !type.IsPrimitive && (isGenericList || typeof(IList).IsAssignableFrom(type)); + + var isNullable = type.IsNullable(); + + Type elementType; + + if (type.IsArray) + { + elementType = type.GetElementType(); + } + else if (isGenericList) + { + var iList = type.GetOpenGenericInterface(typeof(IList<>)); + + elementType = iList.GetGenericArguments()[0]; + } + else + { + elementType = null; + } + + var nonNullType = isNullable ? type.GetGenericArguments()[0] : type; + + var isStringLike = false; + + IJsonConverter converter; + + var jsonConverterAttribute = type.GetCustomAttribute(); + + if (jsonConverterAttribute != null) + { + converter = jsonConverterAttribute.Converter; + } + else if (nonNullType.IsEnum) + { + converter = new EnumConverter(nonNullType); + } + else if (JsonConverterFactory.Instances.TryGetValue(nonNullType, out converter)) + { + } + else if (StringLikeHelper.IsStringLike(nonNullType)) + { + isStringLike = true; + + converter = new StringLikeConverter(nonNullType); + } + + return new TypeDetails(nonNullType) { + NonNullType = nonNullType, + DefaultValue = type.IsValueType ? Activator.CreateInstance(type) : null, + IsNullable = isNullable, + IsList = isList, + IsStringLike = isStringLike, + ElementType = elementType, + JsonConverter = converter + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Helpers/XHelper.cs b/swaggerci/cost-management/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..2b8b753dc34a --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Helpers/XHelper.cs @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal static class XHelper + { + internal static JsonNode Create(JsonType type, TypeCode code, object value) + { + switch (type) + { + case JsonType.Binary : return new XBinary((byte[])value); + case JsonType.Boolean : return new JsonBoolean((bool)value); + case JsonType.Number : return new JsonNumber(value.ToString()); + case JsonType.String : return new JsonString((string)value); + } + + throw new Exception($"JsonType '{type}' does not have a fast conversion"); + } + + internal static bool TryGetElementType(TypeCode code, out JsonType type) + { + switch (code) + { + case TypeCode.Boolean : type = JsonType.Boolean; return true; + case TypeCode.Byte : type = JsonType.Number; return true; + case TypeCode.DateTime : type = JsonType.Date; return true; + case TypeCode.Decimal : type = JsonType.Number; return true; + case TypeCode.Double : type = JsonType.Number; return true; + case TypeCode.Empty : type = JsonType.Null; return true; + case TypeCode.Int16 : type = JsonType.Number; return true; + case TypeCode.Int32 : type = JsonType.Number; return true; + case TypeCode.Int64 : type = JsonType.Number; return true; + case TypeCode.SByte : type = JsonType.Number; return true; + case TypeCode.Single : type = JsonType.Number; return true; + case TypeCode.String : type = JsonType.String; return true; + case TypeCode.UInt16 : type = JsonType.Number; return true; + case TypeCode.UInt32 : type = JsonType.Number; return true; + case TypeCode.UInt64 : type = JsonType.Number; return true; + } + + type = default; + + return false; + } + + internal static JsonType GetElementType(TypeCode code) + { + switch (code) + { + case TypeCode.Boolean : return JsonType.Boolean; + case TypeCode.Byte : return JsonType.Number; + case TypeCode.DateTime : return JsonType.Date; + case TypeCode.Decimal : return JsonType.Number; + case TypeCode.Double : return JsonType.Number; + case TypeCode.Empty : return JsonType.Null; + case TypeCode.Int16 : return JsonType.Number; + case TypeCode.Int32 : return JsonType.Number; + case TypeCode.Int64 : return JsonType.Number; + case TypeCode.SByte : return JsonType.Number; + case TypeCode.Single : return JsonType.Number; + case TypeCode.String : return JsonType.String; + case TypeCode.UInt16 : return JsonType.Number; + case TypeCode.UInt32 : return JsonType.Number; + case TypeCode.UInt64 : return JsonType.Number; + default : return JsonType.Object; + } + + throw new Exception($"TypeCode '{code}' does not have a fast converter"); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/HttpPipeline.cs b/swaggerci/cost-management/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..add453c9e184 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/HttpPipeline.cs @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + using GetEventData = System.Func; + using NextDelegate = System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + + using SignalDelegate = System.Func, System.Threading.Tasks.Task>; + using GetParameterDelegate = System.Func, string, object>; + using SendAsyncStepDelegate = System.Func, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + using PipelineChangeDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>; + using ModuleLoadPipelineDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + using NewRequestPipelineDelegate = System.Action, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + +/* + public class DelegateBasedEventListener : IEventListener + { + private EventListenerDelegate _listener; + public DelegateBasedEventListener(EventListenerDelegate listener) + { + _listener = listener; + } + public CancellationToken Token => CancellationToken.None; + public System.Action Cancel => () => { }; + + + public Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + return _listener(id, token, () => createMessage()); + } + } +*/ + /// + /// This is a necessary extension to the SendAsyncFactory to support the 'generic' delegate format. + /// + public partial class SendAsyncFactory + { + /// + /// This translates a generic-defined delegate for a listener into one that fits our ISendAsync pattern. + /// (Provided to support out-of-module delegation for Azure Cmdlets) + /// + /// The Pipeline Step as a delegate + public SendAsyncFactory(SendAsyncStepDelegate step) => this.implementation = (request, listener, next) => + step( + request, + listener.Token, + listener.Cancel, + (id, token, getEventData) => listener.Signal(id, token, () => { + var data = EventDataConverter.ConvertFrom( getEventData() ) as EventData; + data.Id = id; + data.Cancel = listener.Cancel; + data.RequestMessage = request; + return data; + }), + (req, token, cancel, listenerDelegate) => next.SendAsync(req, listener)); + } + + public partial class HttpPipeline : ISendAsync + { + public HttpPipeline Append(SendAsyncStepDelegate item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStepDelegate item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/cost-management/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..127ff71e037e --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/HttpPipelineMocking.ps1 @@ -0,0 +1,110 @@ +$ErrorActionPreference = "Stop" + +# get the recording path +if (-not $TestRecordingFile) { + $TestRecordingFile = Join-Path $PSScriptRoot 'recording.json' +} + +# create the Http Pipeline Recorder +$Mock = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PipelineMock $TestRecordingFile + +# set the recorder to the appropriate mode (default to 'live') +Write-Host -ForegroundColor Green "Running '$TestMode' mode..." +switch ($TestMode) { + 'record' { + Write-Host -ForegroundColor Green "Recording to $TestRecordingFile" + $Mock.SetRecord() + $null = erase -ea 0 $TestRecordingFile + } + 'playback' { + if (-not (Test-Path $TestRecordingFile)) { + Write-Host -fore:yellow "Recording file '$TestRecordingFile' is not present. Tests expecting recorded responses will fail" + } else { + Write-Host -ForegroundColor Green "Using recording $TestRecordingFile" + } + $Mock.SetPlayback() + $Mock.ForceResponseHeaders["Retry-After"] = "0"; + } + default: { + $Mock.SetLive() + } +} + +# overrides for Pester Describe/Context/It + +function Describe( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushDescription($Name) + try { + return pester\Describe -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopDescription() + } +} + +function Context( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushContext($Name) + try { + return pester\Context -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopContext() + } +} + +function It { + [CmdletBinding(DefaultParameterSetName = 'Normal')] + param( + [Parameter(Mandatory = $true, Position = 0)] + [string]$Name, + + [Parameter(Position = 1)] + [ScriptBlock] $Test = { }, + + [System.Collections.IDictionary[]] $TestCases, + + [Parameter(ParameterSetName = 'Pending')] + [Switch] $Pending, + + [Parameter(ParameterSetName = 'Skip')] + [Alias('Ignore')] + [Switch] $Skip + ) + $Mock.PushScenario($Name) + + try { + if ($skip) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Skip + } + if ($pending) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Pending + } + return pester\It -Name $Name -Test $Test -TestCases $TestCases + } + finally { + $null = $Mock.PopScenario() + } +} + +# set the HttpPipelineAppend for all the cmdlets +$PSDefaultParameterValues["*:HttpPipelinePrepend"] = $Mock diff --git a/swaggerci/cost-management/generated/runtime/IAssociativeArray.cs b/swaggerci/cost-management/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..bd5d21e15e54 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/IAssociativeArray.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +#define DICT_PROPERTIES +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime +{ + /// A subset of IDictionary that doesn't implement IEnumerable or IDictionary to work around PowerShell's aggressive formatter + public interface IAssociativeArray + { +#if DICT_PROPERTIES + System.Collections.Generic.IEnumerable Keys { get; } + System.Collections.Generic.IEnumerable Values { get; } + int Count { get; } +#endif + System.Collections.Generic.IDictionary AdditionalProperties { get; } + T this[string index] { get; set; } + void Add(string key, T value); + bool ContainsKey(string key); + bool Remove(string key); + bool TryGetValue(string key, out T value); + void Clear(); + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/IHeaderSerializable.cs b/swaggerci/cost-management/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..90e12527012b --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/IHeaderSerializable.cs @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/ISendAsync.cs b/swaggerci/cost-management/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..a582fee2c658 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/ISendAsync.cs @@ -0,0 +1,300 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + /// + /// The interface for sending an HTTP request across the wire. + /// + public interface ISendAsync + { + Task SendAsync(HttpRequestMessage request, IEventListener callback); + } + + public class SendAsyncTerminalFactory : ISendAsyncTerminalFactory, ISendAsync + { + SendAsync implementation; + + public SendAsyncTerminalFactory(SendAsync implementation) => this.implementation = implementation; + public SendAsyncTerminalFactory(ISendAsync implementation) => this.implementation = implementation.SendAsync; + public ISendAsync Create() => this; + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback); + } + + public partial class SendAsyncFactory : ISendAsyncFactory + { + public class Sender : ISendAsync + { + internal ISendAsync next; + internal SendAsyncStep implementation; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback, next); + } + SendAsyncStep implementation; + + public SendAsyncFactory(SendAsyncStep implementation) => this.implementation = implementation; + public ISendAsync Create(ISendAsync next) => new Sender { next = next, implementation = implementation }; + + } + + public class HttpClientFactory : ISendAsyncTerminalFactory, ISendAsync + { + HttpClient client; + public HttpClientFactory() : this(new HttpClient()) + { + } + public HttpClientFactory(HttpClient client) => this.client = client; + public ISendAsync Create() => this; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, callback.Token); + } + + public interface ISendAsyncFactory + { + ISendAsync Create(ISendAsync next); + } + + public interface ISendAsyncTerminalFactory + { + ISendAsync Create(); + } + + public partial class HttpPipeline : ISendAsync + { + private ISendAsync pipeline; + private ISendAsyncTerminalFactory terminal; + private List steps = new List(); + + public HttpPipeline() : this(new HttpClientFactory()) + { + } + + public HttpPipeline(ISendAsyncTerminalFactory terminalStep) + { + if (terminalStep == null) + { + throw new System.ArgumentNullException(nameof(terminalStep), "Terminal Step Factory in HttpPipeline may not be null"); + } + TerminalFactory = terminalStep; + } + + /// + /// Returns an HttpPipeline with the current state of this pipeline. + /// + public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + + public ISendAsyncTerminalFactory TerminalFactory + { + get => terminal; + set + { + if (value == null) + { + throw new System.ArgumentNullException("TerminalFactory in HttpPipeline may not be null"); + } + terminal = value; + } + } + + public ISendAsync Pipeline + { + get + { + // if the pipeline has been created and not invalidated, return it. + if (this.pipeline != null) + { + return this.pipeline; + } + + // create the pipeline from scratch. + var next = terminal.Create(); + foreach (var factory in steps) + { + // skip factories that return null. + next = factory.Create(next) ?? next; + } + return this.pipeline = next; + } + } + + public int Count => steps.Count; + + public HttpPipeline Prepend(ISendAsyncFactory item) + { + if (item != null) + { + steps.Add(item); + pipeline = null; + } + return this; + } + + public HttpPipeline Append(SendAsyncStep item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStep item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Append(ISendAsyncFactory item) + { + if (item != null) + { + steps.Insert(0, item); + pipeline = null; + } + return this; + } + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(item); + } + } + return this; + } + + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(item); + } + } + return this; + } + + // you can use this as the ISendAsync Implementation + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => Pipeline.SendAsync(request, callback); + } + + internal static partial class Extensions + { + internal static HttpRequestMessage CloneAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.Clone(requestUri, method); + } + } + + internal static Task CloneWithContentAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.CloneWithContent(requestUri, method); + } + } + + /// + /// Clones an HttpRequestMessage (without the content) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static HttpRequestMessage Clone(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = new HttpRequestMessage + { + Method = method ?? original.Method, + RequestUri = requestUri ?? original.RequestUri, + Version = original.Version, + }; + + foreach (KeyValuePair prop in original.Properties) + { + clone.Properties.Add(prop); + } + + foreach (KeyValuePair> header in original.Headers) + { + /* + **temporarily skip cloning telemetry related headers** + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + */ + if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key)) + { + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + } + + return clone; + } + + /// + /// Clones an HttpRequestMessage (including the content stream and content headers) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static async Task CloneWithContent(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = original.Clone(requestUri, method); + var stream = new System.IO.MemoryStream(); + if (original.Content != null) + { + await original.Content.CopyToAsync(stream).ConfigureAwait(false); + stream.Position = 0; + clone.Content = new StreamContent(stream); + if (original.Content.Headers != null) + { + foreach (var h in original.Content.Headers) + { + clone.Content.Headers.Add(h.Key, h.Value); + } + } + } + return clone; + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/InfoAttribute.cs b/swaggerci/cost-management/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..da73a524baae --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/InfoAttribute.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using System; + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class)] + public class InfoAttribute : Attribute + { + public bool Required { get; set; } = false; + public bool ReadOnly { get; set; } = false; + public Type[] PossibleTypes { get; set; } = new Type[0]; + public string Description { get; set; } = ""; + public string SerializedName { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class CompleterInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class DefaultInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Iso/IsoDate.cs b/swaggerci/cost-management/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..417fe9de2cf5 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Iso/IsoDate.cs @@ -0,0 +1,214 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal struct IsoDate + { + internal int Year { get; set; } // 0-3000 + + internal int Month { get; set; } // 1-12 + + internal int Day { get; set; } // 1-31 + + internal int Hour { get; set; } // 0-24 + + internal int Minute { get; set; } // 0-60 (60 is a special case) + + internal int Second { get; set; } // 0-60 (60 is used for leap seconds) + + internal double Millisecond { get; set; } // 0-999.9... + + internal TimeSpan Offset { get; set; } + + internal DateTimeKind Kind { get; set; } + + internal TimeSpan TimeOfDay => new TimeSpan(Hour, Minute, Second); + + internal DateTime ToDateTime() + { + if (Kind == DateTimeKind.Utc || Offset == TimeSpan.Zero) + { + return new DateTime(Year, Month, Day, Hour, Minute, Second, (int)Millisecond, DateTimeKind.Utc); + } + + return ToDateTimeOffset().DateTime; + } + + internal DateTimeOffset ToDateTimeOffset() + { + return new DateTimeOffset( + Year, + Month, + Day, + Hour, + Minute, + Second, + (int)Millisecond, + Offset + ); + } + + internal DateTime ToUtcDateTime() + { + return ToDateTimeOffset().UtcDateTime; + } + + public override string ToString() + { + var sb = new StringBuilder(); + + // yyyy-MM-dd + sb.Append($"{Year}-{Month:00}-{Day:00}"); + + if (TimeOfDay > new TimeSpan(0)) + { + sb.Append($"T{Hour:00}:{Minute:00}"); + + if (TimeOfDay.Seconds > 0) + { + sb.Append($":{Second:00}"); + } + } + + if (Offset.Ticks == 0) + { + sb.Append('Z'); // UTC + } + else + { + if (Offset.Ticks >= 0) + { + sb.Append('+'); + } + + sb.Append($"{Offset.Hours:00}:{Offset.Minutes:00}"); + } + + return sb.ToString(); + } + + internal static IsoDate FromDateTimeOffset(DateTimeOffset date) + { + return new IsoDate { + Year = date.Year, + Month = date.Month, + Day = date.Day, + Hour = date.Hour, + Minute = date.Minute, + Second = date.Second, + Offset = date.Offset, + Kind = date.Offset == TimeSpan.Zero ? DateTimeKind.Utc : DateTimeKind.Unspecified + }; + } + + private static readonly char[] timeSeperators = { ':', '.' }; + + internal static IsoDate Parse(string text) + { + var tzIndex = -1; + var timeIndex = text.IndexOf('T'); + + var builder = new IsoDate { Day = 1, Month = 1 }; + + // TODO: strip the time zone offset off the end + string dateTime = text; + string timeZone = null; + + if (dateTime.IndexOf('Z') > -1) + { + tzIndex = dateTime.LastIndexOf('Z'); + + builder.Kind = DateTimeKind.Utc; + } + else if (dateTime.LastIndexOf('+') > 10) + { + tzIndex = dateTime.LastIndexOf('+'); + } + else if (dateTime.LastIndexOf('-') > 10) + { + tzIndex = dateTime.LastIndexOf('-'); + } + + if (tzIndex > -1) + { + timeZone = dateTime.Substring(tzIndex); + dateTime = dateTime.Substring(0, tzIndex); + } + + string date = (timeIndex == -1) ? dateTime : dateTime.Substring(0, timeIndex); + + var dateParts = date.Split(Seperator.Dash); // '-' + + for (int i = 0; i < dateParts.Length; i++) + { + var part = dateParts[i]; + + switch (i) + { + case 0: builder.Year = int.Parse(part); break; + case 1: builder.Month = int.Parse(part); break; + case 2: builder.Day = int.Parse(part); break; + } + } + + if (timeIndex > -1) + { + string[] timeParts = dateTime.Substring(timeIndex + 1).Split(timeSeperators); + + for (int i = 0; i < timeParts.Length; i++) + { + var part = timeParts[i]; + + switch (i) + { + case 0: builder.Hour = int.Parse(part); break; + case 1: builder.Minute = int.Parse(part); break; + case 2: builder.Second = int.Parse(part); break; + case 3: builder.Millisecond = double.Parse("0." + part) * 1000; break; + } + } + } + + if (timeZone != null && timeZone != "Z") + { + var hours = int.Parse(timeZone.Substring(1, 2)); + var minutes = int.Parse(timeZone.Substring(4, 2)); + + if (timeZone[0] == '-') + { + hours = -hours; + minutes = -minutes; + } + + builder.Offset = new TimeSpan(hours, minutes, 0); + } + + return builder; + } + } + + /* + YYYY # eg 1997 + YYYY-MM # eg 1997-07 + YYYY-MM-DD # eg 1997-07-16 + YYYY-MM-DDThh:mmTZD # eg 1997-07-16T19:20+01:00 + YYYY-MM-DDThh:mm:ssTZD # eg 1997-07-16T19:20:30+01:00 + YYYY-MM-DDThh:mm:ss.sTZD # eg 1997-07-16T19:20:30.45+01:00 + + where: + + YYYY = four-digit year + MM = two-digit month (01=January, etc.) + DD = two-digit day of month (01 through 31) + hh = two digits of hour (00 through 23) (am/pm NOT allowed) + mm = two digits of minute (00 through 59) + ss = two digits of second (00 through 59) + s = one or more digits representing a decimal fraction of a second + TZD = time zone designator (Z or +hh:mm or -hh:mm) + */ +} diff --git a/swaggerci/cost-management/generated/runtime/JsonType.cs b/swaggerci/cost-management/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..0b5328aec377 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/JsonType.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + internal enum JsonType + { + Null = 0, + Object = 1, + Array = 2, + Binary = 3, + Boolean = 4, + Date = 5, + Number = 6, + String = 7 + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/MessageAttribute.cs b/swaggerci/cost-management/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..a5d4a2f619dc --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/MessageAttribute.cs @@ -0,0 +1,360 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Management.Automation; + using System.Text; + + [AttributeUsage(AttributeTargets.All)] + public class GenericBreakingChangeAttribute : Attribute + { + private string _message; + //A dexcription of what the change is about, non mandatory + public string ChangeDescription { get; set; } = null; + + //The version the change is effective from, non mandatory + public string DeprecateByVersion { get; } + public bool DeprecateByVersionSet { get; } = false; + + //The date on which the change comes in effect + public DateTime ChangeInEfectByDate { get; } + public bool ChangeInEfectByDateSet { get; } = false; + + //Old way of calling the cmdlet + public string OldWay { get; set; } + //New way fo calling the cmdlet + public string NewWay { get; set; } + + public GenericBreakingChangeAttribute(string message) + { + _message = message; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + + if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.ChangeInEfectByDate = result; + this.ChangeInEfectByDateSet = true; + } + } + + public DateTime getInEffectByDate() + { + return this.ChangeInEfectByDate.Date; + } + + + /** + * This function prints out the breaking change message for the attribute on the cmdline + * */ + public void PrintCustomAttributeInfo(Action writeOutput) + { + + if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine)) + { + writeOutput(Environment.NewLine); + } + writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + + + if (!string.IsNullOrWhiteSpace(ChangeDescription)) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesChangeDescriptionMessage, this.ChangeDescription)); + } + + if (ChangeInEfectByDateSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); + } + + if (DeprecateByVersionSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + } + + if (OldWay != null && NewWay != null) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesUsageChangeMessageConsole, OldWay, NewWay)); + } + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + + protected virtual string GetAttributeSpecificMessage() + { + return _message; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute + { + + public string ReplacementCmdletName { get; set; } + + public CmdletBreakingChangeAttribute() : + base(string.Empty) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + } + + protected override string GetAttributeSpecificMessage() + { + if (string.IsNullOrWhiteSpace(ReplacementCmdletName)) + { + return Resources.BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement; + } + else + { + return string.Format(Resources.BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement, ReplacementCmdletName); + } + } + } + + [AttributeUsage(AttributeTargets.All)] + public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string[] ChangedParameterSet { set; get; } + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) : + base(string.Empty) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + ChangedParameterSet = changedParameterSet; + } + + protected override string GetAttributeSpecificMessage() + { + + return Resources.BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement; + + } + + public bool IsApplicableToInvocation(InvocationInfo invocation, string parameterSetName) + { + if (ChangedParameterSet != null) + return ChangedParameterSet.Contains(parameterSetName); + return false; + } + + } + + [AttributeUsage(AttributeTargets.All)] + public class PreviewMessageAttribute : Attribute + { + public string _message; + + public PreviewMessageAttribute() + { + this._message = Resources.PreviewCmdletMessage; + } + + public PreviewMessageAttribute(string message) + { + this._message = message; + } + + public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet) + { + psCmdlet.WriteWarning(this._message); + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string NameOfParameterChanging { get; } + + public string ReplaceMentCmdletParameterName { get; set; } = null; + + public bool IsBecomingMandatory { get; set; } = false; + + public String OldParamaterType { get; set; } + + public String NewParameterType { get; set; } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging) : + base(string.Empty) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + if (!string.IsNullOrWhiteSpace(ReplaceMentCmdletParameterName)) + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplacedMandatory, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplaced, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + } + else + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterMandatoryNow, NameOfParameterChanging)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterChanging, NameOfParameterChanging)); + } + } + + //See if the type of the param is changing + if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterType)) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType, NewParameterType)); + } + return message.ToString(); + } + + /// + /// See if the bound parameters contain the current parameter, if they do + /// then the attribbute is applicable + /// If the invocationInfo is null we return true + /// + /// + /// bool + public override bool IsApplicableToInvocation(InvocationInfo invocationInfo) + { + bool? applicable = invocationInfo == null ? true : invocationInfo.BoundParameters?.Keys?.Contains(this.NameOfParameterChanging); + return applicable.HasValue ? applicable.Value : false; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string DeprecatedCmdLetOutputType { get; } + + //This is still a String instead of a Type as this + //might be undefined at the time of adding the attribute + public string ReplacementCmdletOutputType { get; set; } + + public string[] DeprecatedOutputProperties { get; set; } + + public string[] NewOutputProperties { get; set; } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) : + base(string.Empty) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + + //check for the deprecation scenario + if (string.IsNullOrWhiteSpace(ReplacementCmdletOutputType) && NewOutputProperties == null && DeprecatedOutputProperties == null && string.IsNullOrWhiteSpace(ChangeDescription)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputTypeDeprecated, DeprecatedCmdLetOutputType)); + } + else + { + if (!string.IsNullOrWhiteSpace(ReplacementCmdletOutputType)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange1, DeprecatedCmdLetOutputType, ReplacementCmdletOutputType)); + } + else + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange2, DeprecatedCmdLetOutputType)); + } + + if (DeprecatedOutputProperties != null && DeprecatedOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesRemoved); + foreach (string property in DeprecatedOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + + if (NewOutputProperties != null && NewOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesAdded); + foreach (string property in NewOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + } + return message.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/MessageAttributeHelper.cs b/swaggerci/cost-management/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..48e7d2226c79 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/MessageAttributeHelper.cs @@ -0,0 +1,161 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.Cost.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Management.Automation; + using System.Reflection; + using System.Text; + using System.Threading.Tasks; + public class MessageAttributeHelper + { + public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings"; + public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings"; + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And reads all the deprecation attributes attached to it + * Prints a message on the cmdline For each of the attribute found + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + * */ + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + bool supressWarningOrError = false; + + try + { + supressWarningOrError = bool.Parse(System.Environment.GetEnvironmentVariable(SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME)); + } + catch (Exception) + { + //no action + } + + if (supressWarningOrError) + { + //Do not process the attributes at runtime... The env variable to override the warning messages is set + return; + } + + List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); + StringBuilder sb = new StringBuilder(); + Action appendBreakingChangeInfo = (string s) => sb.Append(s); + + if (attributes != null && attributes.Count > 0) + { + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + + foreach (GenericBreakingChangeAttribute attribute in attributes) + { + attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo); + } + + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + psCmdlet.WriteWarning(sb.ToString()); + } + + List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + + if (previewAttributes != null && previewAttributes.Count > 0) + { + foreach (PreviewMessageAttribute attribute in previewAttributes) + { + attribute.PrintCustomAttributeInfo(psCmdlet); + } + } + } + + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And returns all the deprecation attributes attached to it + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + **/ + private static IEnumerable GetAllBreakingChangeAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet) + { + List attributeList = new List(); + + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); + } + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + List attributeList = new List(); + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.IsApplicableToInvocation(invocationInfo)); + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/Method.cs b/swaggerci/cost-management/generated/runtime/Method.cs new file mode 100644 index 000000000000..ade70d9bc115 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Method.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + internal static class Method + { + internal static System.Net.Http.HttpMethod Get = System.Net.Http.HttpMethod.Get; + internal static System.Net.Http.HttpMethod Put = System.Net.Http.HttpMethod.Put; + internal static System.Net.Http.HttpMethod Head = System.Net.Http.HttpMethod.Head; + internal static System.Net.Http.HttpMethod Post = System.Net.Http.HttpMethod.Post; + internal static System.Net.Http.HttpMethod Delete = System.Net.Http.HttpMethod.Delete; + internal static System.Net.Http.HttpMethod Options = System.Net.Http.HttpMethod.Options; + internal static System.Net.Http.HttpMethod Trace = System.Net.Http.HttpMethod.Trace; + internal static System.Net.Http.HttpMethod Patch = new System.Net.Http.HttpMethod("PATCH"); + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Models/JsonMember.cs b/swaggerci/cost-management/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..9eb8372bfefb --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Models/JsonMember.cs @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Reflection; +using System.Runtime.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + + + internal sealed class JsonMember + { + private readonly TypeDetails type; + + private readonly Func getter; + private readonly Action setter; + + internal JsonMember(PropertyInfo property, int defaultOrder) + { + getter = property.GetValue; + setter = property.SetValue; + + var dataMember = property.GetCustomAttribute(); + + Name = dataMember?.Name ?? property.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(property.PropertyType); + + CanRead = property.CanRead; + } + + internal JsonMember(FieldInfo field, int defaultOrder) + { + getter = field.GetValue; + setter = field.SetValue; + + var dataMember = field.GetCustomAttribute(); + + Name = dataMember?.Name ?? field.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(field.FieldType); + + CanRead = true; + } + + internal string Name { get; } + + internal int Order { get; } + + internal TypeDetails TypeDetails => type; + + internal Type Type => type.NonNullType; + + internal bool IsList => type.IsList; + + // Arrays, Sets, ... + internal Type ElementType => type.ElementType; + + internal IJsonConverter Converter => type.JsonConverter; + + internal bool EmitDefaultValue { get; } + + internal bool IsStringLike => type.IsStringLike; + + internal object DefaultValue => type.DefaultValue; + + internal bool CanRead { get; } + + #region Helpers + + internal object GetValue(object instance) => getter(instance); + + internal void SetValue(object instance, object value) => setter(instance, value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Models/JsonModel.cs b/swaggerci/cost-management/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..d07f7a828dcd --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Models/JsonModel.cs @@ -0,0 +1,89 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Runtime.Serialization; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal class JsonModel + { + private Dictionary map; + private readonly object _sync = new object(); + + private JsonModel(Type type, List members) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + Members = members ?? throw new ArgumentNullException(nameof(members)); + } + + internal string Name => Type.Name; + + internal Type Type { get; } + + internal List Members { get; } + + internal JsonMember this[string name] + { + get + { + if (map == null) + { + lock (_sync) + { + if (map == null) + { + map = new Dictionary(); + + foreach (JsonMember m in Members) + { + map[m.Name.ToLower()] = m; + } + } + } + } + + + map.TryGetValue(name.ToLower(), out JsonMember member); + + return member; + } + } + + internal static JsonModel FromType(Type type) + { + var members = new List(); + + int i = 0; + + // BindingFlags.Instance | BindingFlags.Public + + foreach (var member in type.GetFields()) + { + if (member.IsStatic) continue; + + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + foreach (var member in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + members.Sort((a, b) => a.Order.CompareTo(b.Order)); // inline sort + + return new JsonModel(type, members); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Models/JsonModelCache.cs b/swaggerci/cost-management/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..a5cb8196e84b --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Models/JsonModelCache.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Runtime.CompilerServices; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal static class JsonModelCache + { + private static readonly ConditionalWeakTable cache + = new ConditionalWeakTable(); + + internal static JsonModel Get(Type type) => cache.GetValue(type, Create); + + private static JsonModel Create(Type type) => JsonModel.FromType(type); + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/cost-management/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..da933869ccb6 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/Collections/JsonArray.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public abstract partial class JsonArray : JsonNode, IEnumerable + { + internal override JsonType Type => JsonType.Array; + + internal abstract JsonType? ElementType { get; } + + public abstract int Count { get; } + + internal virtual bool IsSet => false; + + internal bool IsEmpty => Count == 0; + + #region IEnumerable + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + #region Static Helpers + + internal static JsonArray Create(short[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(int[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(long[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(decimal[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(float[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(string[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(XBinary[] values) + => new XImmutableArray(values); + + #endregion + + internal static new JsonArray Parse(string text) + => (JsonArray)JsonNode.Parse(text); + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/cost-management/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..e99312909e30 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/Collections/XImmutableArray.cs @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal sealed class XImmutableArray : JsonArray, IEnumerable + { + private readonly T[] values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XImmutableArray(T[] values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Length; + + public bool IsReadOnly => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + #region Static Constructor + + internal XImmutableArray Create(T[] items) + { + return new XImmutableArray(items); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/cost-management/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..6c1407bcfcd6 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/Collections/XList.cs @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal sealed class XList : JsonArray, IEnumerable + { + private readonly IList values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XList(IList values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Count; + + public bool IsReadOnly => values.IsReadOnly; + + #region IList + + public void Add(T value) + { + values.Add(value); + } + + public bool Contains(T value) => values.Contains(value); + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/cost-management/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..96861ed464b2 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed partial class XNodeArray : JsonArray, ICollection + { + private readonly List items; + + internal XNodeArray() + { + items = new List(); + } + + internal XNodeArray(params JsonNode[] values) + { + items = new List(values); + } + + public override JsonNode this[int index] => items[index]; + + internal override JsonType? ElementType => null; + + public bool IsReadOnly => false; + + public override int Count => items.Count; + + #region ICollection Members + + public void Add(JsonNode item) + { + items.Add(item); + } + + void ICollection.Clear() + { + items.Clear(); + } + + public bool Contains(JsonNode item) => items.Contains(item); + + void ICollection.CopyTo(JsonNode[] array, int arrayIndex) + { + items.CopyTo(array, arrayIndex); + } + + public bool Remove(JsonNode item) + { + return items.Remove(item); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/cost-management/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..291a15637ee7 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/Collections/XSet.cs @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal sealed class XSet : JsonArray, IEnumerable + { + private readonly HashSet values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XSet(IEnumerable values) + : this(new HashSet(values)) + { } + + internal XSet(HashSet values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + internal override JsonType Type => JsonType.Array; + + internal override JsonType? ElementType => elementType; + + public bool IsReadOnly => true; + + public override int Count => values.Count; + + internal override bool IsSet => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + internal HashSet AsHashSet() => values; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/cost-management/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..9f900b4a7722 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/JsonBoolean.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal sealed partial class JsonBoolean : JsonNode + { + internal static readonly JsonBoolean True = new JsonBoolean(true); + internal static readonly JsonBoolean False = new JsonBoolean(false); + + internal JsonBoolean(bool value) + { + Value = value; + } + + internal bool Value { get; } + + internal override JsonType Type => JsonType.Boolean; + + internal static new JsonBoolean Parse(string text) + { + switch (text) + { + case "false": return False; + case "true": return True; + + default: throw new ArgumentException($"Expected true or false. Was {text}."); + } + } + + #region Implicit Casts + + public static implicit operator bool(JsonBoolean data) => data.Value; + + public static implicit operator JsonBoolean(bool data) => new JsonBoolean(data); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/JsonDate.cs b/swaggerci/cost-management/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..ee3f5fe3cbd0 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/JsonDate.cs @@ -0,0 +1,173 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + + + internal sealed partial class JsonDate : JsonNode, IEquatable, IComparable + { + internal static bool AssumeUtcWhenKindIsUnspecified = true; + + private readonly DateTimeOffset value; + + internal JsonDate(DateTime value) + { + if (value.Kind == DateTimeKind.Unspecified && AssumeUtcWhenKindIsUnspecified) + { + value = DateTime.SpecifyKind(value, DateTimeKind.Utc); + } + + this.value = value; + } + + internal JsonDate(DateTimeOffset value) + { + this.value = value; + } + + internal override JsonType Type => JsonType.Date; + + #region Helpers + + internal DateTimeOffset ToDateTimeOffset() + { + return value; + } + + internal DateTime ToDateTime() + { + if (value.Offset == TimeSpan.Zero) + { + return value.UtcDateTime; + } + + return value.DateTime; + } + + internal DateTime ToUtcDateTime() => value.UtcDateTime; + + internal int ToUnixTimeSeconds() + { + return (int)value.ToUnixTimeSeconds(); + } + + internal long ToUnixTimeMilliseconds() + { + return (int)value.ToUnixTimeMilliseconds(); + } + + internal string ToIsoString() + { + return IsoDate.FromDateTimeOffset(value).ToString(); + } + + #endregion + + public override string ToString() + { + return ToIsoString(); + } + + internal static new JsonDate Parse(string text) + { + if (text == null) throw new ArgumentNullException(nameof(text)); + + // TODO support: unixtimeseconds.partialseconds + + if (text.Length > 4 && _IsNumber(text)) // UnixTime + { + var date = DateTimeOffset.FromUnixTimeSeconds(long.Parse(text)); + + return new JsonDate(date); + } + else if (text.Length <= 4 || text[4] == '-') // ISO: 2012- + { + return new JsonDate(IsoDate.Parse(text).ToDateTimeOffset()); + } + else + { + // NOT ISO ENCODED + // "Thu, 5 Apr 2012 16:59:01 +0200", + return new JsonDate(DateTimeOffset.Parse(text)); + } + } + + private static bool _IsNumber(string text) + { + foreach (var c in text) + { + if (!char.IsDigit(c)) return false; + } + + return true; + } + + internal static JsonDate FromUnixTime(int seconds) + { + return new JsonDate(DateTimeOffset.FromUnixTimeSeconds(seconds)); + } + + internal static JsonDate FromUnixTime(double seconds) + { + var milliseconds = (long)(seconds * 1000d); + + return new JsonDate(DateTimeOffset.FromUnixTimeMilliseconds(milliseconds)); + } + + #region Implicit Casts + + public static implicit operator DateTimeOffset(JsonDate value) + => value.ToDateTimeOffset(); + + public static implicit operator DateTime(JsonDate value) + => value.ToDateTime(); + + // From Date + public static implicit operator JsonDate(DateTimeOffset value) + { + return new JsonDate(value); + } + + public static implicit operator JsonDate(DateTime value) + { + return new JsonDate(value); + } + + // From String + public static implicit operator JsonDate(string value) + { + return Parse(value); + } + + #endregion + + #region Equality + + public override bool Equals(object obj) + { + return obj is JsonDate date && date.value == this.value; + } + + public bool Equals(JsonDate other) + { + return this.value == other.value; + } + + public override int GetHashCode() => value.GetHashCode(); + + #endregion + + #region IComparable Members + + int IComparable.CompareTo(JsonDate other) + { + return value.CompareTo(other.value); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/JsonNode.cs b/swaggerci/cost-management/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..82529d2d985c --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/JsonNode.cs @@ -0,0 +1,250 @@ +/*--------------------------------------------------------------------------------------------- + * 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.IO; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + + + public abstract partial class JsonNode + { + internal abstract JsonType Type { get; } + + public virtual JsonNode this[int index] => throw new NotImplementedException(); + + public virtual JsonNode this[string name] + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #region Type Helpers + + internal bool IsArray => Type == JsonType.Array; + + internal bool IsDate => Type == JsonType.Date; + + internal bool IsObject => Type == JsonType.Object; + + internal bool IsNumber => Type == JsonType.Number; + + internal bool IsNull => Type == JsonType.Null; + + #endregion + + internal void WriteTo(TextWriter textWriter, bool pretty = true) + { + var writer = new JsonWriter(textWriter, pretty); + + writer.WriteNode(this); + } + + internal T As() + where T : new() + => new JsonSerializer().Deseralize((JsonObject)this); + + internal T[] ToArrayOf() + { + return (T[])new JsonSerializer().DeserializeArray(typeof(T[]), (JsonArray)this); + } + + #region ToString Overrides + + public override string ToString() => ToString(pretty: true); + + internal string ToString(bool pretty) + { + var sb = new StringBuilder(); + + using (var writer = new StringWriter(sb)) + { + WriteTo(writer, pretty); + + return sb.ToString(); + } + } + + #endregion + + #region Static Constructors + + internal static JsonNode Parse(string text) + { + return Parse(new SourceReader(new StringReader(text))); + } + + internal static JsonNode Parse(TextReader textReader) + => Parse(new SourceReader(textReader)); + + private static JsonNode Parse(SourceReader sourceReader) + { + using (var parser = new JsonParser(sourceReader)) + { + return parser.ReadNode(); + } + } + + internal static JsonNode FromObject(object instance) + => new JsonSerializer().Serialize(instance); + + #endregion + + #region Implict Casts + + public static implicit operator string(JsonNode node) => node.ToString(); + + #endregion + + #region Explict Casts + + public static explicit operator DateTime(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date: + return ((JsonDate)node).ToDateTime(); + + case JsonType.String: + return JsonDate.Parse(node.ToString()).ToDateTime(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num).UtcDateTime; + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)).UtcDateTime; + } + } + + throw new ConversionException(node, typeof(DateTime)); + } + + public static explicit operator DateTimeOffset(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date : return ((JsonDate)node).ToDateTimeOffset(); + case JsonType.String : return JsonDate.Parse(node.ToString()).ToDateTimeOffset(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num); + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)); + } + + } + + throw new ConversionException(node, typeof(DateTimeOffset)); + } + + public static explicit operator float(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return float.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(float)); + } + + public static explicit operator double(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return double.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(double)); + } + + public static explicit operator decimal(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return decimal.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(decimal)); + } + + public static explicit operator Guid(JsonNode node) + => new Guid(node.ToString()); + + public static explicit operator short(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return short.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(short)); + } + + public static explicit operator int(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return int.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(int)); + } + + public static explicit operator long(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return long.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(long)); + } + + public static explicit operator bool(JsonNode node) + => ((JsonBoolean)node).Value; + + public static explicit operator ushort(JsonNode node) + => (JsonNumber)node; + + public static explicit operator uint(JsonNode node) + => (JsonNumber)node; + + public static explicit operator ulong(JsonNode node) + => (JsonNumber)node; + + public static explicit operator TimeSpan(JsonNode node) + => TimeSpan.Parse(node.ToString()); + + public static explicit operator Uri(JsonNode node) + { + if (node.Type == JsonType.String) + { + return new Uri(node.ToString()); + } + + throw new ConversionException(node, typeof(Uri)); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/cost-management/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..5406319a01d1 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/JsonNumber.cs @@ -0,0 +1,109 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed partial class JsonNumber : JsonNode + { + private readonly string value; + private readonly bool overflows = false; + + internal JsonNumber(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal JsonNumber(int value) + { + this.value = value.ToString(); + } + + internal JsonNumber(long value) + { + this.value = value.ToString(); + + if (value > 9007199254740991) + { + overflows = true; + } + } + + internal JsonNumber(float value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal JsonNumber(double value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal override JsonType Type => JsonType.Number; + + internal string Value => value; + + #region Helpers + + internal bool Overflows => overflows; + + internal bool IsInteger => !value.Contains("."); + + internal bool IsFloat => value.Contains("."); + + #endregion + + #region Casting + + public static implicit operator byte(JsonNumber number) + => byte.Parse(number.Value); + + public static implicit operator short(JsonNumber number) + => short.Parse(number.Value); + + public static implicit operator int(JsonNumber number) + => int.Parse(number.Value); + + public static implicit operator long(JsonNumber number) + => long.Parse(number.value); + + public static implicit operator UInt16(JsonNumber number) + => ushort.Parse(number.Value); + + public static implicit operator UInt32(JsonNumber number) + => uint.Parse(number.Value); + + public static implicit operator UInt64(JsonNumber number) + => ulong.Parse(number.Value); + + public static implicit operator decimal(JsonNumber number) + => decimal.Parse(number.Value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator Double(JsonNumber number) + => double.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator float(JsonNumber number) + => float.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator JsonNumber(short data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(int data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(long data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(Single data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(double data) + => new JsonNumber(data.ToString()); + + #endregion + + public override string ToString() => value; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/JsonObject.cs b/swaggerci/cost-management/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..e16035c097a2 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/JsonObject.cs @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public partial class JsonObject : JsonNode, IDictionary + { + private readonly Dictionary items; + + internal JsonObject() + { + items = new Dictionary(); + } + + internal JsonObject(IEnumerable> properties) + { + if (properties == null) throw new ArgumentNullException(nameof(properties)); + + items = new Dictionary(); + + foreach (var field in properties) + { + items.Add(field.Key, field.Value); + } + } + + #region IDictionary Constructors + + internal JsonObject(IDictionary dic) + { + items = new Dictionary(dic.Count); + + foreach (var pair in dic) + { + Add(pair.Key, pair.Value); + } + } + + #endregion + + internal override JsonType Type => JsonType.Object; + + #region Add Overloads + + public void Add(string name, JsonNode value) => + items.Add(name, value); + + public void Add(string name, byte[] value) => + items.Add(name, new XBinary(value)); + + public void Add(string name, DateTime value) => + items.Add(name, new JsonDate(value)); + + public void Add(string name, int value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, long value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, float value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, double value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, string value) => + items.Add(name, new JsonString(value)); + + public void Add(string name, bool value) => + items.Add(name, new JsonBoolean(value)); + + public void Add(string name, Uri url) => + items.Add(name, new JsonString(url.AbsoluteUri)); + + public void Add(string name, string[] values) => + items.Add(name, new XImmutableArray(values)); + + public void Add(string name, int[] values) => + items.Add(name, new XImmutableArray(values)); + + #endregion + + #region ICollection> Members + + void ICollection>.Add(KeyValuePair item) + { + items.Add(item.Key, item.Value); + } + + void ICollection>.Clear() + { + items.Clear(); + } + + bool ICollection>.Contains(KeyValuePair item) => + throw new NotImplementedException(); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => + throw new NotImplementedException(); + + + int ICollection>.Count => items.Count; + + bool ICollection>.IsReadOnly => false; + + bool ICollection>.Remove(KeyValuePair item) => + throw new NotImplementedException(); + + #endregion + + #region IDictionary Members + + public bool ContainsKey(string key) => items.ContainsKey(key); + + public ICollection Keys => items.Keys; + + public bool Remove(string key) => items.Remove(key); + + public bool TryGetValue(string key, out JsonNode value) => + items.TryGetValue(key, out value); + + public ICollection Values => items.Values; + + public override JsonNode this[string key] + { + get => items[key]; + set => items[key] = value; + } + + #endregion + + #region IEnumerable + + IEnumerator> IEnumerable>.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + + #region Helpers + + internal static new JsonObject FromObject(object instance) => + (JsonObject)new JsonSerializer().Serialize(instance); + + #endregion + + #region Static Constructors + + internal static JsonObject FromStream(Stream stream) + { + using (var tr = new StreamReader(stream)) + { + return (JsonObject)Parse(tr); + } + } + + internal static new JsonObject Parse(string text) + { + return (JsonObject)JsonNode.Parse(text); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/JsonString.cs b/swaggerci/cost-management/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..956f78b2a04b --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/JsonString.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed partial class JsonString : JsonNode, IEquatable + { + private readonly string value; + + internal JsonString(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal override JsonType Type => JsonType.String; + + internal string Value => value; + + internal int Length => value.Length; + + #region #region Implicit Casts + + public static implicit operator string(JsonString data) => data.Value; + + public static implicit operator JsonString(string value) => new JsonString(value); + + #endregion + + public override int GetHashCode() => value.GetHashCode(); + + public override string ToString() => value; + + #region IEquatable + + bool IEquatable.Equals(JsonString other) => this.Value == other.Value; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/XBinary.cs b/swaggerci/cost-management/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..7d881a31df25 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/XBinary.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal sealed class XBinary : JsonNode + { + private readonly byte[] _value; + private readonly string _base64; + + internal XBinary(byte[] value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal XBinary(string base64EncodedString) + { + _base64 = base64EncodedString ?? throw new ArgumentNullException(nameof(base64EncodedString)); + } + + internal override JsonType Type => JsonType.Binary; + + internal byte[] Value => _value ?? Convert.FromBase64String(_base64); + + #region #region Implicit Casts + + public static implicit operator byte[] (XBinary data) => data.Value; + + public static implicit operator XBinary(byte[] data) => new XBinary(data); + + #endregion + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => _base64 ?? Convert.ToBase64String(_value); + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Nodes/XNull.cs b/swaggerci/cost-management/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..742a129af470 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Nodes/XNull.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + internal sealed class XNull : JsonNode + { + internal static readonly XNull Instance = new XNull(); + + private XNull() { } + + internal override JsonType Type => JsonType.Null; + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/cost-management/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..f6611b92a625 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Parser/Exceptions/ParseException.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal class ParserException : Exception + { + internal ParserException(string message) + : base(message) + { } + + internal ParserException(string message, SourceLocation location) + : base(message) + { + + Location = location; + } + + internal SourceLocation Location { get; } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Parser/JsonParser.cs b/swaggerci/cost-management/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..5cebc99198f0 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Parser/JsonParser.cs @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public class JsonParser : IDisposable + { + private readonly TokenReader reader; + + internal JsonParser(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonParser(SourceReader sourceReader) + { + if (sourceReader == null) + throw new ArgumentNullException(nameof(sourceReader)); + + this.reader = new TokenReader(new JsonTokenizer(sourceReader)); + + this.reader.Next(); // Start with the first token + } + + internal IEnumerable ReadNodes() + { + JsonNode node; + + while ((node = ReadNode()) != null) yield return node; + } + + internal JsonNode ReadNode() + { + if (reader.Current.Kind == TokenKind.Eof || reader.Current.IsTerminator) + { + return null; + } + + switch (reader.Current.Kind) + { + case TokenKind.LeftBrace : return ReadObject(); // { + case TokenKind.LeftBracket : return ReadArray(); // [ + + default: throw new ParserException($"Expected '{{' or '['. Was {reader.Current}."); + } + } + + private JsonNode ReadFieldValue() + { + // Boolean, Date, Null, Number, String, Uri + if (reader.Current.IsLiteral) + { + return ReadLiteral(); + } + else + { + switch (reader.Current.Kind) + { + case TokenKind.LeftBracket: return ReadArray(); + case TokenKind.LeftBrace : return ReadObject(); + + default: throw new ParserException($"Unexpected token reading field value. Was {reader.Current}."); + } + } + } + + private JsonNode ReadLiteral() + { + var literal = reader.Current; + + reader.Next(); // Read the literal token + + switch (literal.Kind) + { + case TokenKind.Boolean : return JsonBoolean.Parse(literal.Value); + case TokenKind.Null : return XNull.Instance; + case TokenKind.Number : return new JsonNumber(literal.Value); + case TokenKind.String : return new JsonString(literal.Value); + + default: throw new ParserException($"Unexpected token reading literal. Was {literal}."); + } + } + + internal JsonObject ReadObject() + { + reader.Ensure(TokenKind.LeftBrace, "object"); + + reader.Next(); // Read '{' (Object start) + + var jsonObject = new JsonObject(); + + // Read the object's fields until we reach the end of the object ('}') + while (reader.Current.Kind != TokenKind.RightBrace) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read ',' (Seperator) + } + + // Ensure we have a field name + reader.Ensure(TokenKind.String, "Expected field name"); + + var field = ReadField(); + + jsonObject.Add(field.Key, field.Value); + } + + reader.Next(); // Read '}' (Object end) + + return jsonObject; + } + + + // TODO: Use ValueTuple in C#7 + private KeyValuePair ReadField() + { + var fieldName = reader.Current.Value; + + reader.Next(); // Read the field name + + reader.Ensure(TokenKind.Colon, "field"); + + reader.Next(); // Read ':' (Field value indicator) + + return new KeyValuePair(fieldName, ReadFieldValue()); + } + + + internal JsonArray ReadArray() + { + reader.Ensure(TokenKind.LeftBracket, "array"); + + var array = new XNodeArray(); + + reader.Next(); // Read the '[' (Array start) + + // Read the array's items + while (reader.Current.Kind != TokenKind.RightBracket) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read the ',' (Seperator) + } + + if (reader.Current.IsLiteral) + { + array.Add(ReadLiteral()); // Boolean, Date, Number, Null, String, Uri + } + else if (reader.Current.Kind == TokenKind.LeftBracket) + { + array.Add(ReadArray()); // Array + } + else if (reader.Current.Kind == TokenKind.LeftBrace) + { + array.Add(ReadObject()); // Object + } + else + { + throw new ParserException($"Expected comma, literal, or object. Was {reader.Current}."); + } + } + + reader.Next(); // Read the ']' (Array end) + + return array; + } + + #region IDisposable + + public void Dispose() + { + reader.Dispose(); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Parser/JsonToken.cs b/swaggerci/cost-management/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..6f8b08a896fa --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Parser/JsonToken.cs @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + internal enum TokenKind + { + LeftBrace, // { Object start + RightBrace, // } Object end + + LeftBracket, // [ Array start + RightBracket, // ] Array end + + Comma, // , Comma + Colon, // : Value indicator + Dot, // . Access field indicator + Terminator, // \0 Stream terminator + + Boolean = 31, // true or false + Null = 33, // null + Number = 34, // i.e. -1.93, -1, 0, 1, 1.1 + String = 35, // i.e. "text" + + Eof = 50 + } + + internal /* readonly */ struct JsonToken + { + internal static readonly JsonToken BraceOpen = new JsonToken(TokenKind.LeftBrace, "{"); + internal static readonly JsonToken BraceClose = new JsonToken(TokenKind.RightBrace, "}"); + + internal static readonly JsonToken BracketOpen = new JsonToken(TokenKind.LeftBracket, "["); + internal static readonly JsonToken BracketClose = new JsonToken(TokenKind.RightBracket, "]"); + + internal static readonly JsonToken Colon = new JsonToken(TokenKind.Colon, ":"); + internal static readonly JsonToken Comma = new JsonToken(TokenKind.Comma, ","); + internal static readonly JsonToken Terminator = new JsonToken(TokenKind.Terminator, "\0"); + + internal static readonly JsonToken True = new JsonToken(TokenKind.Boolean, "true"); + internal static readonly JsonToken False = new JsonToken(TokenKind.Boolean, "false"); + internal static readonly JsonToken Null = new JsonToken(TokenKind.Null, "null"); + + internal static readonly JsonToken Eof = new JsonToken(TokenKind.Eof, null); + + internal JsonToken(TokenKind kind, string value) + { + Kind = kind; + Value = value; + } + + internal readonly TokenKind Kind; + + internal readonly string Value; + + public override string ToString() => Kind + ": " + Value; + + #region Helpers + + internal bool IsLiteral => (byte)Kind > 30 && (byte)Kind < 40; + + internal bool IsTerminator => Kind == TokenKind.Terminator; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/cost-management/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..55ff7ce38d57 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Parser/JsonTokenizer.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + using System.IO; + + + public class JsonTokenizer : IDisposable + { + private readonly StringBuilder sb = new StringBuilder(); + + private readonly SourceReader reader; + + internal JsonTokenizer(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonTokenizer(SourceReader reader) + { + this.reader = reader; + + reader.Next(); // Start with the first char + } + + internal JsonToken ReadNext() + { + reader.SkipWhitespace(); + + if (reader.IsEof) return JsonToken.Eof; + + switch (reader.Current) + { + case '"': return ReadQuotedString(); + + // Symbols + case '[' : reader.Next(); return JsonToken.BracketOpen; // Array start + case ']' : reader.Next(); return JsonToken.BracketClose; // Array end + case ',' : reader.Next(); return JsonToken.Comma; // Value seperator + case ':' : reader.Next(); return JsonToken.Colon; // Field value indicator + case '{' : reader.Next(); return JsonToken.BraceOpen; // Object start + case '}' : reader.Next(); return JsonToken.BraceClose; // Object end + case '\0' : reader.Next(); return JsonToken.Terminator; // Stream terminiator + + default: return ReadLiteral(); + } + } + + private JsonToken ReadQuotedString() + { + Expect('"', "quoted string indicator"); + + reader.Next(); // Read '"' (Starting quote) + + // Read until we reach an unescaped quote char + while (reader.Current != '"') + { + EnsureNotEof("quoted string"); + + if (reader.Current == '\\') + { + char escapedCharacter = reader.ReadEscapeCode(); + + sb.Append(escapedCharacter); + + continue; + } + + StoreCurrentCharacterAndReadNext(); + } + + reader.Next(); // Read '"' (Ending quote) + + return new JsonToken(TokenKind.String, value: sb.Extract()); + } + + private JsonToken ReadLiteral() + { + if (char.IsDigit(reader.Current) || + reader.Current == '-' || + reader.Current == '+') + { + return ReadNumber(); + } + + return ReadIdentifer(); + } + + private JsonToken ReadNumber() + { + // Read until we hit a non-numeric character + // -6.247737e-06 + // E + + while (char.IsDigit(reader.Current) + || reader.Current == '.' + || reader.Current == 'e' + || reader.Current == 'E' + || reader.Current == '-' + || reader.Current == '+') + { + StoreCurrentCharacterAndReadNext(); + } + + return new JsonToken(TokenKind.Number, value: sb.Extract()); + } + + int count = 0; + + private JsonToken ReadIdentifer() + { + count++; + + if (!char.IsLetter(reader.Current)) + { + throw new ParserException( + message : $"Expected literal (number, boolean, or null). Was '{reader.Current}'.", + location : reader.Location + ); + } + + // Read letters, numbers, and underscores '_' + while (char.IsLetterOrDigit(reader.Current) || reader.Current == '_') + { + StoreCurrentCharacterAndReadNext(); + } + + string text = sb.Extract(); + + switch (text) + { + case "true": return JsonToken.True; + case "false": return JsonToken.False; + case "null": return JsonToken.Null; + + default: return new JsonToken(TokenKind.String, text); + } + } + + private void Expect(char character, string description) + { + if (reader.Current != character) + { + throw new ParserException( + message: $"Expected {description} ('{character}'). Was '{reader.Current}'.", + location: reader.Location + ); + } + } + + private void EnsureNotEof(string tokenType) + { + if (reader.IsEof) + { + throw new ParserException( + message: $"Unexpected EOF while reading {tokenType}.", + location: reader.Location + ); + } + } + + private void StoreCurrentCharacterAndReadNext() + { + sb.Append(reader.Current); + + reader.Next(); + } + + public void Dispose() + { + reader.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Parser/Location.cs b/swaggerci/cost-management/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..f3ae771c2156 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Parser/Location.cs @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime.Json +{ + internal struct SourceLocation + { + private int line; + private int column; + private int position; + + internal SourceLocation(int line = 0, int column = 0, int position = 0) + { + this.line = line; + this.column = column; + this.position = position; + } + + internal int Line => line; + + internal int Column => column; + + internal int Position => position; + + internal void Advance() + { + this.column++; + this.position++; + } + + internal void MarkNewLine() + { + this.line++; + this.column = 0; + } + + internal SourceLocation Clone() + { + return new SourceLocation(line, column, position); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/cost-management/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..9fcae7481bf1 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Parser/Readers/SourceReader.cs @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Globalization; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public sealed class SourceReader : IDisposable + { + private readonly TextReader source; + + private char current; + + private readonly SourceLocation location = new SourceLocation(); + + private bool isEof = false; + + internal SourceReader(TextReader textReader) + { + this.source = textReader ?? throw new ArgumentNullException(nameof(textReader)); + } + + /// + /// Advances to the next character + /// + internal void Next() + { + // Advance to the new line when we see a new line '\n'. + // A new line may be prefixed by a carriage return '\r'. + + if (current == '\n') + { + location.MarkNewLine(); + } + + int charCode = source.Read(); // -1 for end + + if (charCode >= 0) + { + current = (char)charCode; + } + else + { + // If we've already marked this as the EOF, throw an exception + if (isEof) + { + throw new EndOfStreamException("Cannot advance past end of stream."); + } + + isEof = true; + + current = '\0'; + } + + location.Advance(); + } + + internal void SkipWhitespace() + { + while (char.IsWhiteSpace(current)) + { + Next(); + } + } + + internal char ReadEscapeCode() + { + Next(); + + char escapedChar = current; + + Next(); // Consume escaped character + + switch (escapedChar) + { + // Special escape codes + case '"': return '"'; // " (Quotation mark) U+0022 + case '/': return '/'; // / (Solidus) U+002F + case '\\': return '\\'; // \ (Reverse solidus) U+005C + + // Control Characters + case '0': return '\0'; // Nul (0) U+0000 + case 'a': return '\a'; // Alert (7) + case 'b': return '\b'; // Backspace (8) U+0008 + case 'f': return '\f'; // Form feed (12) U+000C + case 'n': return '\n'; // Line feed (10) U+000A + case 'r': return '\r'; // Carriage return (13) U+000D + case 't': return '\t'; // Horizontal tab (9) U+0009 + case 'v': return '\v'; // Vertical tab + + // Unicode escape sequence + case 'u': return ReadUnicodeEscapeSequence(); // U+XXXX + + default: throw new Exception($"Unrecognized escape sequence '\\{escapedChar}'"); + } + } + + private readonly char[] hexCode = new char[4]; + + private char ReadUnicodeEscapeSequence() + { + hexCode[0] = current; Next(); + hexCode[1] = current; Next(); + hexCode[2] = current; Next(); + hexCode[3] = current; Next(); + + return Convert.ToChar(int.Parse( + s : new string(hexCode), + style : NumberStyles.HexNumber, + provider: NumberFormatInfo.InvariantInfo + )); + } + + internal char Current => current; + + internal bool IsEof => isEof; + + internal char Peek() => (char)source.Peek(); + + internal SourceLocation Location => location; + + public void Dispose() + { + source.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Parser/TokenReader.cs b/swaggerci/cost-management/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..222b1973d403 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Parser/TokenReader.cs @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + public class TokenReader : IDisposable + { + private readonly JsonTokenizer tokenizer; + private JsonToken current; + + internal TokenReader(JsonTokenizer tokenizer) + { + this.tokenizer = tokenizer ?? throw new ArgumentNullException(nameof(tokenizer)); + } + + internal void Next() + { + current = tokenizer.ReadNext(); + } + + internal JsonToken Current => current; + + internal void Ensure(TokenKind kind, string readerName) + { + if (current.Kind != kind) + { + throw new ParserException($"Expected {kind} while reading {readerName}). Was {current}."); + } + } + + public void Dispose() + { + tokenizer.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/PipelineMocking.cs b/swaggerci/cost-management/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..9a34e60bf0a6 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/PipelineMocking.cs @@ -0,0 +1,262 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json; + + public enum MockMode + { + Live, + Record, + Playback, + + } + + public class PipelineMock + { + + private System.Collections.Generic.Stack scenario = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack context = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack description = new System.Collections.Generic.Stack(); + + private readonly string recordingPath; + private int counter = 0; + + public static implicit operator Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep(PipelineMock instance) => instance.SendAsync; + + public MockMode Mode { get; set; } = MockMode.Live; + public PipelineMock(string recordingPath) + { + this.recordingPath = recordingPath; + } + + public void PushContext(string text) => context.Push(text); + + public void PushDescription(string text) => description.Push(text); + + + public void PushScenario(string it) + { + // reset counter too + counter = 0; + + scenario.Push(it); + } + + public void PopContext() => context.Pop(); + + public void PopDescription() => description.Pop(); + + public void PopScenario() => scenario.Pop(); + + public void SetRecord() => Mode = MockMode.Record; + + public void SetPlayback() => Mode = MockMode.Playback; + + public void SetLive() => Mode = MockMode.Live; + + public string Scenario => (scenario.Count > 0 ? scenario.Peek() : "[NoScenario]"); + public string Description => (description.Count > 0 ? description.Peek() : "[NoDescription]"); + public string Context => (context.Count > 0 ? context.Peek() : "[NoContext]"); + + /// + /// Headers that we substitute out blank values for in the recordings + /// Add additional headers as necessary + /// + public static HashSet Blacklist = new HashSet(System.StringComparer.CurrentCultureIgnoreCase) { + "Authorization", + }; + + public Dictionary ForceResponseHeaders = new Dictionary(); + + internal static XImmutableArray Removed = new XImmutableArray(new string[] { "[Filtered]" }); + + internal static IEnumerable> FilterHeaders(IEnumerable>> headers) => headers.Select(header => new KeyValuePair(header.Key, Blacklist.Contains(header.Key) ? Removed : new XImmutableArray(header.Value.ToArray()))); + + internal static JsonNode SerializeContent(HttpContent content, ref bool isBase64) => content == null ? XNull.Instance : SerializeContent(content.ReadAsByteArrayAsync().Result, ref isBase64); + + internal static JsonNode SerializeContent(byte[] content, ref bool isBase64) + { + if (null == content || content.Length == 0) + { + return XNull.Instance; + } + var first = content[0]; + var last = content[content.Length - 1]; + + // plaintext for JSON/SGML/XML/HTML/STRINGS/ARRAYS + if ((first == '{' && last == '}') || (first == '<' && last == '>') || (first == '[' && last == ']') || (first == '"' && last == '"')) + { + return new JsonString(System.Text.Encoding.UTF8.GetString(content)); + } + + // base64 for everyone else + return new JsonString(System.Convert.ToBase64String(content)); + } + + internal static byte[] DeserializeContent(string content, bool isBase64) + { + if (string.IsNullOrWhiteSpace(content)) + { + return new byte[0]; + } + + if (isBase64) + { + try + { + return System.Convert.FromBase64String(content); + } + catch + { + // hmm. didn't work, return it as a string I guess. + } + } + return System.Text.Encoding.UTF8.GetBytes(content); + } + + public void SaveMessage(string rqKey, HttpRequestMessage request, HttpResponseMessage response) + { + var messages = System.IO.File.Exists(this.recordingPath) ? Load() : new JsonObject() ?? new JsonObject(); + bool isBase64Request = false; + bool isBase64Response = false; + messages[rqKey] = new JsonObject { + { "Request",new JsonObject { + { "Method", request.Method.Method }, + { "RequestUri", request.RequestUri }, + { "Content", SerializeContent( request.Content, ref isBase64Request) }, + { "isContentBase64", isBase64Request }, + { "Headers", new JsonObject(FilterHeaders(request.Headers)) }, + { "ContentHeaders", request.Content == null ? new JsonObject() : new JsonObject(FilterHeaders(request.Content.Headers))} + } }, + {"Response", new JsonObject { + { "StatusCode", (int)response.StatusCode}, + { "Headers", new JsonObject(FilterHeaders(response.Headers))}, + { "ContentHeaders", new JsonObject(FilterHeaders(response.Content.Headers))}, + { "Content", SerializeContent(response.Content, ref isBase64Response) }, + { "isContentBase64", isBase64Response }, + }} + }; + System.IO.File.WriteAllText(this.recordingPath, messages.ToString()); + } + + private JsonObject Load() + { + if (System.IO.File.Exists(this.recordingPath)) + { + try + { + return JsonObject.FromStream(System.IO.File.OpenRead(this.recordingPath)); + } + catch + { + throw new System.Exception($"Invalid recording file: '{recordingPath}'"); + } + } + + throw new System.ArgumentException($"Missing recording file: '{recordingPath}'", nameof(recordingPath)); + } + + public HttpResponseMessage LoadMessage(string rqKey) + { + var responses = Load(); + var message = responses.Property(rqKey); + + if (null == message) + { + throw new System.ArgumentException($"Missing Request '{rqKey}' in recording file", nameof(rqKey)); + } + + var sc = 0; + var reqMessage = message.Property("Request"); + var respMessage = message.Property("Response"); + + // --------------------------- deserialize response ---------------------------------------------------------------- + bool isBase64Response = false; + respMessage.BooleanProperty("isContentBase64", ref isBase64Response); + var response = new HttpResponseMessage + { + StatusCode = (HttpStatusCode)respMessage.NumberProperty("StatusCode", ref sc), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(respMessage.StringProperty("Content"), isBase64Response)) + }; + + foreach (var each in respMessage.Property("Headers")) + { + response.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + foreach (var frh in ForceResponseHeaders) + { + response.Headers.Remove(frh.Key); + response.Headers.TryAddWithoutValidation(frh.Key, frh.Value); + } + + foreach (var each in respMessage.Property("ContentHeaders")) + { + response.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + // --------------------------- deserialize request ---------------------------------------------------------------- + bool isBase64Request = false; + reqMessage.BooleanProperty("isContentBase64", ref isBase64Request); + response.RequestMessage = new HttpRequestMessage + { + Method = new HttpMethod(reqMessage.StringProperty("Method")), + RequestUri = new System.Uri(reqMessage.StringProperty("RequestUri")), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(reqMessage.StringProperty("Content"), isBase64Request)) + }; + + foreach (var each in reqMessage.Property("Headers")) + { + response.RequestMessage.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + foreach (var each in reqMessage.Property("ContentHeaders")) + { + response.RequestMessage.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + return response; + } + + public async Task SendAsync(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + counter++; + var rqkey = $"{Description}+{Context}+{Scenario}+${request.Method.Method}+{request.RequestUri}+{counter}"; + + switch (Mode) + { + case MockMode.Record: + //Add following code since the request.Content will be released after sendAsync + var requestClone = request; + if (requestClone.Content != null) + { + requestClone = await request.CloneWithContent(request.RequestUri, request.Method); + } + // make the call + var response = await next.SendAsync(request, callback); + + // save the message to the recording file + SaveMessage(rqkey, requestClone, response); + + // return the response. + return response; + + case MockMode.Playback: + // load and return the response. + return LoadMessage(rqkey); + + default: + // pass-thru, do nothing + return await next.SendAsync(request, callback); + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/cost-management/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..b050842d520b --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Properties/Resources.Designer.cs @@ -0,0 +1,5633 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.generated.runtime.Properties +{ + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.PowerShell.Cmdlets.Cost.generated.runtime.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The remote server returned an error: (401) Unauthorized.. + /// + public static string AccessDeniedExceptionMessage + { + get + { + return ResourceManager.GetString("AccessDeniedExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account id doesn't match one in subscription.. + /// + public static string AccountIdDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("AccountIdDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account needs to be specified. + /// + public static string AccountNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account "{0}" has been added.. + /// + public static string AddAccountAdded + { + get + { + return ResourceManager.GetString("AddAccountAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To switch to a different subscription, please use Select-AzureSubscription.. + /// + public static string AddAccountChangeSubscription + { + get + { + return ResourceManager.GetString("AddAccountChangeSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential".. + /// + public static string AddAccountNonInteractiveGuestOrFpo + { + get + { + return ResourceManager.GetString("AddAccountNonInteractiveGuestOrFpo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription "{0}" is selected as the default subscription.. + /// + public static string AddAccountShowDefaultSubscription + { + get + { + return ResourceManager.GetString("AddAccountShowDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To view all the subscriptions, please use Get-AzureSubscription.. + /// + public static string AddAccountViewSubscriptions + { + get + { + return ResourceManager.GetString("AddAccountViewSubscriptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is created successfully.. + /// + public static string AddOnCreatedMessage + { + get + { + return ResourceManager.GetString("AddOnCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on name {0} is already used.. + /// + public static string AddOnNameAlreadyUsed + { + get + { + return ResourceManager.GetString("AddOnNameAlreadyUsed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} not found.. + /// + public static string AddOnNotFound + { + get + { + return ResourceManager.GetString("AddOnNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on {0} is removed successfully.. + /// + public static string AddOnRemovedMessage + { + get + { + return ResourceManager.GetString("AddOnRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is updated successfully.. + /// + public static string AddOnUpdatedMessage + { + get + { + return ResourceManager.GetString("AddOnUpdatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}.. + /// + public static string AddRoleMessageCreate + { + get + { + return ResourceManager.GetString("AddRoleMessageCreate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’.. + /// + public static string AddRoleMessageCreateNode + { + get + { + return ResourceManager.GetString("AddRoleMessageCreateNode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure".. + /// + public static string AddRoleMessageCreatePHP + { + get + { + return ResourceManager.GetString("AddRoleMessageCreatePHP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator. + /// + public static string AddRoleMessageInsufficientPermissions + { + get + { + return ResourceManager.GetString("AddRoleMessageInsufficientPermissions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A role name '{0}' already exists. + /// + public static string AddRoleMessageRoleExists + { + get + { + return ResourceManager.GetString("AddRoleMessageRoleExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} already has an endpoint with name {1}. + /// + public static string AddTrafficManagerEndpointFailed + { + get + { + return ResourceManager.GetString("AddTrafficManagerEndpointFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. + ///Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable [rest of string was truncated]";. + /// + public static string ARMDataCollectionMessage + { + get + { + return ResourceManager.GetString("ARMDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}.. + /// + public static string AuthenticatingForSingleTenant + { + get + { + return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows Azure Powershell\. + /// + public static string AzureDirectory + { + get + { + return ResourceManager.GetString("AzureDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://manage.windowsazure.com. + /// + public static string AzurePortalUrl + { + get + { + return ResourceManager.GetString("AzurePortalUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PORTAL_URL. + /// + public static string AzurePortalUrlEnv + { + get + { + return ResourceManager.GetString("AzurePortalUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected profile must not be null.. + /// + public static string AzureProfileMustNotBeNull + { + get + { + return ResourceManager.GetString("AzureProfileMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure SDK\{0}\. + /// + public static string AzureSdkDirectory + { + get + { + return ResourceManager.GetString("AzureSdkDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscArchiveAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscArchiveAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find configuration data file: {0}. + /// + public static string AzureVMDscCannotFindConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscCannotFindConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create Archive. + /// + public static string AzureVMDscCreateArchiveAction + { + get + { + return ResourceManager.GetString("AzureVMDscCreateArchiveAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The configuration data must be a .psd1 file. + /// + public static string AzureVMDscInvalidConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscInvalidConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing configuration script: {0}. + /// + public static string AzureVMDscParsingConfiguration + { + get + { + return ResourceManager.GetString("AzureVMDscParsingConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscStorageBlobAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscStorageBlobAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upload '{0}'. + /// + public static string AzureVMDscUploadToBlobStorageAction + { + get + { + return ResourceManager.GetString("AzureVMDscUploadToBlobStorageAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execution failed because a background thread could not prompt the user.. + /// + public static string BaseShouldMethodFailureReason + { + get + { + return ResourceManager.GetString("BaseShouldMethodFailureReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Uri was empty.. + /// + public static string BaseUriEmpty + { + get + { + return ResourceManager.GetString("BaseUriEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing without ParameterSet.. + /// + public static string BeginProcessingWithoutParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithoutParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing with ParameterSet '{1}'.. + /// + public static string BeginProcessingWithParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Blob with the name {0} already exists in the account.. + /// + public static string BlobAlreadyExistsInTheAccount + { + get + { + return ResourceManager.GetString("BlobAlreadyExistsInTheAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}.blob.core.windows.net/. + /// + public static string BlobEndpointUri + { + get + { + return ResourceManager.GetString("BlobEndpointUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_BLOBSTORAGE_TEMPLATE. + /// + public static string BlobEndpointUriEnv + { + get + { + return ResourceManager.GetString("BlobEndpointUriEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is changing.. + /// + public static string BreakingChangeAttributeParameterChanging + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterChanging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is becoming mandatory.. + /// + public static string BreakingChangeAttributeParameterMandatoryNow + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterMandatoryNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplaced + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplaced", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by mandatory parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplacedMandatory + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplacedMandatory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the parameter is changing from '{0}' to '{1}'.. + /// + public static string BreakingChangeAttributeParameterTypeChange + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterTypeChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change description : {0} + ///. + /// + public static string BreakingChangesAttributesChangeDescriptionMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesChangeDescriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet '{0}' is replacing this cmdlet.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type is changing from the existing type :'{0}' to the new type :'{1}'. + /// + public static string BreakingChangesAttributesCmdLetOutputChange1 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "The output type '{0}' is changing". + /// + public static string BreakingChangesAttributesCmdLetOutputChange2 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + ///- The following properties are being added to the output type : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesAdded + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + /// - The following properties in the output type are being deprecated : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesRemoved + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesRemoved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type '{0}' is being deprecated without a replacement.. + /// + public static string BreakingChangesAttributesCmdLetOutputTypeDeprecated + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputTypeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0} + /// + ///. + /// + public static string BreakingChangesAttributesDeclarationMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - Cmdlet : '{0}' + /// - {1} + ///. + /// + public static string BreakingChangesAttributesDeclarationMessageWithCmdletName + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessageWithCmdletName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to NOTE : Go to {0} for steps to suppress (and other related information on) the breaking change messages.. + /// + public static string BreakingChangesAttributesFooterMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesFooterMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Breaking changes in the cmdlet '{0}' :. + /// + public static string BreakingChangesAttributesHeaderMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesHeaderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note : This change will take effect on '{0}' + ///. + /// + public static string BreakingChangesAttributesInEffectByDateMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByDateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from the version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ```powershell + ///# Old + ///{0} + /// + ///# New + ///{1} + ///``` + /// + ///. + /// + public static string BreakingChangesAttributesUsageChangeMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cmdlet invocation changes : + /// Old Way : {0} + /// New Way : {1}. + /// + public static string BreakingChangesAttributesUsageChangeMessageConsole + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessageConsole", resourceCulture); + } + } + + /// + /// The cmdlet is in experimental stage. The function may not be enabled in current subscription. + /// + public static string ExperimentalCmdletMessage + { + get + { + return ResourceManager.GetString("ExperimentalCmdletMessage", resourceCulture); + } + } + + + + /// + /// Looks up a localized string similar to CACHERUNTIMEURL. + /// + public static string CacheRuntimeUrl + { + get + { + return ResourceManager.GetString("CacheRuntimeUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cache. + /// + public static string CacheRuntimeValue + { + get + { + return ResourceManager.GetString("CacheRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CacheRuntimeVersion. + /// + public static string CacheRuntimeVersionKey + { + get + { + return ResourceManager.GetString("CacheRuntimeVersionKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}). + /// + public static string CacheVersionWarningText + { + get + { + return ResourceManager.GetString("CacheVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot change built-in environment {0}.. + /// + public static string CannotChangeBuiltinEnvironment + { + get + { + return ResourceManager.GetString("CannotChangeBuiltinEnvironment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find {0} with name {1}.. + /// + public static string CannotFind + { + get + { + return ResourceManager.GetString("CannotFind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment for service {0} with {1} slot doesn't exist. + /// + public static string CannotFindDeployment + { + get + { + return ResourceManager.GetString("CannotFindDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't find valid Microsoft Azure role in current directory {0}. + /// + public static string CannotFindRole + { + get + { + return ResourceManager.GetString("CannotFindRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist. + /// + public static string CannotFindServiceConfigurationFile + { + get + { + return ResourceManager.GetString("CannotFindServiceConfigurationFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders.. + /// + public static string CannotFindServiceRoot + { + get + { + return ResourceManager.GetString("CannotFindServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated.. + /// + public static string CannotUpdateUnknownSubscription + { + get + { + return ResourceManager.GetString("CannotUpdateUnknownSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ManagementCertificate. + /// + public static string CertificateElementName + { + get + { + return ResourceManager.GetString("CertificateElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to certificate.pfx. + /// + public static string CertificateFileName + { + get + { + return ResourceManager.GetString("CertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate imported into CurrentUser\My\{0}. + /// + public static string CertificateImportedMessage + { + get + { + return ResourceManager.GetString("CertificateImportedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. + /// + public static string CertificateNotFoundInStore + { + get + { + return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your account does not have access to the private key for certificate {0}. + /// + public static string CertificatePrivateKeyAccessError + { + get + { + return ResourceManager.GetString("CertificatePrivateKeyAccessError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} deployment for {2} service. + /// + public static string ChangeDeploymentStateWaitMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStateWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cloud service {0} is in {1} state.. + /// + public static string ChangeDeploymentStatusCompleteMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStatusCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing/Removing public environment '{0}' is not allowed.. + /// + public static string ChangePublicEnvironmentMessage + { + get + { + return ResourceManager.GetString("ChangePublicEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} is set to value {1}. + /// + public static string ChangeSettingsElementMessage + { + get + { + return ResourceManager.GetString("ChangeSettingsElementMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing public environment is not supported.. + /// + public static string ChangingDefaultEnvironmentNotSupported + { + get + { + return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choose which publish settings file to use:. + /// + public static string ChoosePublishSettingsFile + { + get + { + return ResourceManager.GetString("ChoosePublishSettingsFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel. + /// + public static string ClientDiagnosticLevelName + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string ClientDiagnosticLevelValue + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cloud_package.cspkg. + /// + public static string CloudPackageFileName + { + get + { + return ResourceManager.GetString("CloudPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Cloud.cscfg. + /// + public static string CloudServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("CloudServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-ons for {0}. + /// + public static string CloudServiceDescription + { + get + { + return ResourceManager.GetString("CloudServiceDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive.. + /// + public static string CommunicationCouldNotBeEstablished + { + get + { + return ResourceManager.GetString("CommunicationCouldNotBeEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete. + /// + public static string CompleteMessage + { + get + { + return ResourceManager.GetString("CompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OperationID : '{0}'. + /// + public static string ComputeCloudExceptionOperationIdMessage + { + get + { + return ResourceManager.GetString("ComputeCloudExceptionOperationIdMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to config.json. + /// + public static string ConfigurationFileName + { + get + { + return ResourceManager.GetString("ConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to VirtualMachine creation failed.. + /// + public static string CreateFailedErrorMessage + { + get + { + return ResourceManager.GetString("CreateFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead.. + /// + public static string CreateWebsiteFailed + { + get + { + return ResourceManager.GetString("CreateWebsiteFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core. + /// + public static string DataCacheClientsType + { + get + { + return ResourceManager.GetString("DataCacheClientsType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //blobcontainer[@datacenter='{0}']. + /// + public static string DatacenterBlobQuery + { + get + { + return ResourceManager.GetString("DatacenterBlobQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure PowerShell Data Collection Confirmation. + /// + public static string DataCollectionActivity + { + get + { + return ResourceManager.GetString("DataCollectionActivity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose not to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmNo + { + get + { + return ResourceManager.GetString("DataCollectionConfirmNo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This confirmation message will be dismissed in '{0}' second(s).... + /// + public static string DataCollectionConfirmTime + { + get + { + return ResourceManager.GetString("DataCollectionConfirmTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmYes + { + get + { + return ResourceManager.GetString("DataCollectionConfirmYes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The setting profile has been saved to the following path '{0}'.. + /// + public static string DataCollectionSaveFileInformation + { + get + { + return ResourceManager.GetString("DataCollectionSaveFileInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription. + /// + public static string DefaultAndCurrentSubscription + { + get + { + return ResourceManager.GetString("DefaultAndCurrentSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to none. + /// + public static string DefaultFileVersion + { + get + { + return ResourceManager.GetString("DefaultFileVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are no hostnames which could be used for validation.. + /// + public static string DefaultHostnamesValidation + { + get + { + return ResourceManager.GetString("DefaultHostnamesValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 8080. + /// + public static string DefaultPort + { + get + { + return ResourceManager.GetString("DefaultPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string DefaultRoleCachingInMB + { + get + { + return ResourceManager.GetString("DefaultRoleCachingInMB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto. + /// + public static string DefaultUpgradeMode + { + get + { + return ResourceManager.GetString("DefaultUpgradeMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 80. + /// + public static string DefaultWebPort + { + get + { + return ResourceManager.GetString("DefaultWebPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string Delete + { + get + { + return ResourceManager.GetString("Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for service {1} is already in {2} state. + /// + public static string DeploymentAlreadyInState + { + get + { + return ResourceManager.GetString("DeploymentAlreadyInState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment in {0} slot for service {1} is removed. + /// + public static string DeploymentRemovedMessage + { + get + { + return ResourceManager.GetString("DeploymentRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel. + /// + public static string DiagnosticLevelName + { + get + { + return ResourceManager.GetString("DiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string DiagnosticLevelValue + { + get + { + return ResourceManager.GetString("DiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key to add already exists in the dictionary.. + /// + public static string DictionaryAddAlreadyContainsKey + { + get + { + return ResourceManager.GetString("DictionaryAddAlreadyContainsKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The array index cannot be less than zero.. + /// + public static string DictionaryCopyToArrayIndexLessThanZero + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayIndexLessThanZero", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The supplied array does not have enough room to contain the copied elements.. + /// + public static string DictionaryCopyToArrayTooShort + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayTooShort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided dns {0} doesn't exist. + /// + public static string DnsDoesNotExist + { + get + { + return ResourceManager.GetString("DnsDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure Certificate. + /// + public static string EnableRemoteDesktop_FriendlyCertificateName + { + get + { + return ResourceManager.GetString("EnableRemoteDesktop_FriendlyCertificateName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Endpoint can't be retrieved for storage account. + /// + public static string EndPointNotFoundForBlobStorage + { + get + { + return ResourceManager.GetString("EndPointNotFoundForBlobStorage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} end processing.. + /// + public static string EndProcessingLog + { + get + { + return ResourceManager.GetString("EndProcessingLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet.. + /// + public static string EnvironmentDoesNotSupportActiveDirectory + { + get + { + return ResourceManager.GetString("EnvironmentDoesNotSupportActiveDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment '{0}' already exists.. + /// + public static string EnvironmentExists + { + get + { + return ResourceManager.GetString("EnvironmentExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name doesn't match one in subscription.. + /// + public static string EnvironmentNameDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("EnvironmentNameDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name needs to be specified.. + /// + public static string EnvironmentNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment needs to be specified.. + /// + public static string EnvironmentNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment name '{0}' is not found.. + /// + public static string EnvironmentNotFound + { + get + { + return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to environments.xml. + /// + public static string EnvironmentsFileName + { + get + { + return ResourceManager.GetString("EnvironmentsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error creating VirtualMachine. + /// + public static string ErrorCreatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorCreatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to download available runtimes for location '{0}'. + /// + public static string ErrorRetrievingRuntimesForLocation + { + get + { + return ResourceManager.GetString("ErrorRetrievingRuntimesForLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error updating VirtualMachine. + /// + public static string ErrorUpdatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorUpdatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} failed. Error: {1}, ExceptionDetails: {2}. + /// + public static string FailedJobErrorMessage + { + get + { + return ResourceManager.GetString("FailedJobErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File path is not valid.. + /// + public static string FilePathIsNotValid + { + get + { + return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP request was forbidden with client authentication scheme 'Anonymous'.. + /// + public static string FirstPurchaseErrorMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell.. + /// + public static string FirstPurchaseMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation Status:. + /// + public static string GatewayOperationStatus + { + get + { + return ResourceManager.GetString("GatewayOperationStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\General. + /// + public static string GeneralScaffolding + { + get + { + return ResourceManager.GetString("GeneralScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting all available Microsoft Azure Add-Ons, this may take few minutes.... + /// + public static string GetAllAddOnsWaitMessage + { + get + { + return ResourceManager.GetString("GetAllAddOnsWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name{0}Primary Key{0}Seconday Key. + /// + public static string GetStorageKeysHeader + { + get + { + return ResourceManager.GetString("GetStorageKeysHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Git not found. Please install git and place it in your command line path.. + /// + public static string GitNotFound + { + get + { + return ResourceManager.GetString("GitNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find publish settings. Please run Import-AzurePublishSettingsFile.. + /// + public static string GlobalSettingsManager_Load_PublishSettingsNotFound + { + get + { + return ResourceManager.GetString("GlobalSettingsManager_Load_PublishSettingsNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg end element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoEndWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoEndWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WadCfg start element in the config is not matching the end element.. + /// + public static string IaasDiagnosticsBadConfigNoMatchingWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoMatchingWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode.dll. + /// + public static string IISNodeDll + { + get + { + return ResourceManager.GetString("IISNodeDll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeEngineKey + { + get + { + return ResourceManager.GetString("IISNodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode-dev\\release\\x64. + /// + public static string IISNodePath + { + get + { + return ResourceManager.GetString("IISNodePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeRuntimeValue + { + get + { + return ResourceManager.GetString("IISNodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}). + /// + public static string IISNodeVersionWarningText + { + get + { + return ResourceManager.GetString("IISNodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illegal characters in path.. + /// + public static string IllegalPath + { + get + { + return ResourceManager.GetString("IllegalPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. + /// + public static string InternalServerErrorMessage + { + get + { + return ResourceManager.GetString("InternalServerErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot enable memcach protocol on a cache worker role {0}.. + /// + public static string InvalidCacheRoleName + { + get + { + return ResourceManager.GetString("InvalidCacheRoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. + /// + public static string InvalidCertificate + { + get + { + return ResourceManager.GetString("InvalidCertificate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format.. + /// + public static string InvalidCertificateSingle + { + get + { + return ResourceManager.GetString("InvalidCertificateSingle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided configuration path is invalid or doesn't exist. + /// + public static string InvalidConfigPath + { + get + { + return ResourceManager.GetString("InvalidConfigPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2.. + /// + public static string InvalidCountryNameMessage + { + get + { + return ResourceManager.GetString("InvalidCountryNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. + /// + public static string InvalidDefaultSubscription + { + get + { + return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment with {0} does not exist. + /// + public static string InvalidDeployment + { + get + { + return ResourceManager.GetString("InvalidDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production".. + /// + public static string InvalidDeploymentSlot + { + get + { + return ResourceManager.GetString("InvalidDeploymentSlot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. + /// + public static string InvalidDnsName + { + get + { + return ResourceManager.GetString("InvalidDnsName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service endpoint.. + /// + public static string InvalidEndpoint + { + get + { + return ResourceManager.GetString("InvalidEndpoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. + /// + public static string InvalidFileExtension + { + get + { + return ResourceManager.GetString("InvalidFileExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File {0} has invalid characters. + /// + public static string InvalidFileName + { + get + { + return ResourceManager.GetString("InvalidFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your git publishing credentials using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. On the left side open "Web Sites" + ///2. Click on any website + ///3. Choose "Setup Git Publishing" or "Reset deployment credentials" + ///4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username}. + /// + public static string InvalidGitCredentials + { + get + { + return ResourceManager.GetString("InvalidGitCredentials", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value {0} provided is not a valid GUID. Please provide a valid GUID.. + /// + public static string InvalidGuid + { + get + { + return ResourceManager.GetString("InvalidGuid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified hostname does not exist. Please specify a valid hostname for the site.. + /// + public static string InvalidHostnameValidation + { + get + { + return ResourceManager.GetString("InvalidHostnameValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances must be greater than or equal 0 and less than or equal 20. + /// + public static string InvalidInstancesCount + { + get + { + return ResourceManager.GetString("InvalidInstancesCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file.. + /// + public static string InvalidJobFile + { + get + { + return ResourceManager.GetString("InvalidJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not download a valid runtime manifest, Please check your internet connection and try again.. + /// + public static string InvalidManifestError + { + get + { + return ResourceManager.GetString("InvalidManifestError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The account {0} was not found. Please specify a valid account name.. + /// + public static string InvalidMediaServicesAccount + { + get + { + return ResourceManager.GetString("InvalidMediaServicesAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided name "{0}" does not match the service bus namespace naming rules.. + /// + public static string InvalidNamespaceName + { + get + { + return ResourceManager.GetString("InvalidNamespaceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path must specify a valid path to an Azure profile.. + /// + public static string InvalidNewProfilePath + { + get + { + return ResourceManager.GetString("InvalidNewProfilePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be null. Parameter name: '{0}'. + /// + public static string InvalidNullArgument + { + get + { + return ResourceManager.GetString("InvalidNullArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is invalid or empty. + /// + public static string InvalidOrEmptyArgumentMessage + { + get + { + return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided package path is invalid or doesn't exist. + /// + public static string InvalidPackagePath + { + get + { + return ResourceManager.GetString("InvalidPackagePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is an invalid parameter set name.. + /// + public static string InvalidParameterSetName + { + get + { + return ResourceManager.GetString("InvalidParameterSetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} doesn't exist in {1} or you've not passed valid value for it. + /// + public static string InvalidPath + { + get + { + return ResourceManager.GetString("InvalidPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} has invalid characters. + /// + public static string InvalidPathName + { + get + { + return ResourceManager.GetString("InvalidPathName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token}. + /// + public static string InvalidProfileProperties + { + get + { + return ResourceManager.GetString("InvalidProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile. + /// + public static string InvalidPublishSettingsSchema + { + get + { + return ResourceManager.GetString("InvalidPublishSettingsSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name "{0}" has invalid characters. + /// + public static string InvalidRoleNameMessage + { + get + { + return ResourceManager.GetString("InvalidRoleNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid name for the service root folder is required. + /// + public static string InvalidRootNameMessage + { + get + { + return ResourceManager.GetString("InvalidRootNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a recognized runtime type. + /// + public static string InvalidRuntimeError + { + get + { + return ResourceManager.GetString("InvalidRuntimeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid language is required. + /// + public static string InvalidScaffoldingLanguageArg + { + get + { + return ResourceManager.GetString("InvalidScaffoldingLanguageArg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscription is currently selected. Use Select-Subscription to activate a subscription.. + /// + public static string InvalidSelectedSubscription + { + get + { + return ResourceManager.GetString("InvalidSelectedSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations.. + /// + public static string InvalidServiceBusLocation + { + get + { + return ResourceManager.GetString("InvalidServiceBusLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide a service name or run this command from inside a service project directory.. + /// + public static string InvalidServiceName + { + get + { + return ResourceManager.GetString("InvalidServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must provide valid value for {0}. + /// + public static string InvalidServiceSettingElement + { + get + { + return ResourceManager.GetString("InvalidServiceSettingElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to settings.json is invalid or doesn't exist. + /// + public static string InvalidServiceSettingMessage + { + get + { + return ResourceManager.GetString("InvalidServiceSettingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data.. + /// + public static string InvalidSubscription + { + get + { + return ResourceManager.GetString("InvalidSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscription id {0} is not valid. + /// + public static string InvalidSubscriptionId + { + get + { + return ResourceManager.GetString("InvalidSubscriptionId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Must specify a non-null subscription name.. + /// + public static string InvalidSubscriptionName + { + get + { + return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet. + /// + public static string InvalidSubscriptionNameMessage + { + get + { + return ResourceManager.GetString("InvalidSubscriptionNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscriptions file {0} has invalid content.. + /// + public static string InvalidSubscriptionsDataSchema + { + get + { + return ResourceManager.GetString("InvalidSubscriptionsDataSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge.. + /// + public static string InvalidVMSize + { + get + { + return ResourceManager.GetString("InvalidVMSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The web job file must have *.zip extension. + /// + public static string InvalidWebJobFile + { + get + { + return ResourceManager.GetString("InvalidWebJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Singleton option works for continuous jobs only.. + /// + public static string InvalidWebJobSingleton + { + get + { + return ResourceManager.GetString("InvalidWebJobSingleton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The website {0} was not found. Please specify a valid website name.. + /// + public static string InvalidWebsite + { + get + { + return ResourceManager.GetString("InvalidWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No job for id: {0} was found.. + /// + public static string JobNotFound + { + get + { + return ResourceManager.GetString("JobNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to engines. + /// + public static string JsonEnginesSectionName + { + get + { + return ResourceManager.GetString("JsonEnginesSectionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scaffolding for this language is not yet supported. + /// + public static string LanguageScaffoldingIsNotSupported + { + get + { + return ResourceManager.GetString("LanguageScaffoldingIsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Link already established. + /// + public static string LinkAlreadyEstablished + { + get + { + return ResourceManager.GetString("LinkAlreadyEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to local_package.csx. + /// + public static string LocalPackageFileName + { + get + { + return ResourceManager.GetString("LocalPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Local.cscfg. + /// + public static string LocalServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("LocalServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for {0} deployment for {1} cloud service.... + /// + public static string LookingForDeploymentMessage + { + get + { + return ResourceManager.GetString("LookingForDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for cloud service {0}.... + /// + public static string LookingForServiceMessage + { + get + { + return ResourceManager.GetString("LookingForServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure Long-Running Job. + /// + public static string LROJobName + { + get + { + return ResourceManager.GetString("LROJobName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter.. + /// + public static string LROTaskExceptionMessage + { + get + { + return ResourceManager.GetString("LROTaskExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to managementCertificate.pem. + /// + public static string ManagementCertificateFileName + { + get + { + return ResourceManager.GetString("ManagementCertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ?whr={0}. + /// + public static string ManagementPortalRealmFormat + { + get + { + return ResourceManager.GetString("ManagementPortalRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //baseuri. + /// + public static string ManifestBaseUriQuery + { + get + { + return ResourceManager.GetString("ManifestBaseUriQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uri. + /// + public static string ManifestBlobUriKey + { + get + { + return ResourceManager.GetString("ManifestBlobUriKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml. + /// + public static string ManifestUri + { + get + { + return ResourceManager.GetString("ManifestUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'.. + /// + public static string MissingCertificateInProfileProperties + { + get + { + return ResourceManager.GetString("MissingCertificateInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'.. + /// + public static string MissingPasswordInProfileProperties + { + get + { + return ResourceManager.GetString("MissingPasswordInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'SubscriptionId'.. + /// + public static string MissingSubscriptionInProfileProperties + { + get + { + return ResourceManager.GetString("MissingSubscriptionInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple Add-Ons found holding name {0}. + /// + public static string MultipleAddOnsFoundMessage + { + get + { + return ResourceManager.GetString("MultipleAddOnsFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername.. + /// + public static string MultiplePublishingUsernames + { + get + { + return ResourceManager.GetString("MultiplePublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The first publish settings file "{0}" is used. If you want to use another file specify the file name.. + /// + public static string MultiplePublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("MultiplePublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.NamedCaches. + /// + public static string NamedCacheSettingName + { + get + { + return ResourceManager.GetString("NamedCacheSettingName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}. + /// + public static string NamedCacheSettingValue + { + get + { + return ResourceManager.GetString("NamedCacheSettingValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A publishing username is required. Please specify one using the argument PublishingUsername.. + /// + public static string NeedPublishingUsernames + { + get + { + return ResourceManager.GetString("NeedPublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Add-On Confirmation. + /// + public static string NewAddOnConformation + { + get + { + return ResourceManager.GetString("NewAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string NewMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names.. + /// + public static string NewNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("NewNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at {0} and (c) agree to sharing my contact information with {2}.. + /// + public static string NewNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service has been created at {0}. + /// + public static string NewServiceCreatedMessage + { + get + { + return ResourceManager.GetString("NewServiceCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + public static string No + { + get + { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription.. + /// + public static string NoCachedToken + { + get + { + return ResourceManager.GetString("NoCachedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole.. + /// + public static string NoCacheWorkerRoles + { + get + { + return ResourceManager.GetString("NoCacheWorkerRoles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No clouds available. + /// + public static string NoCloudsAvailable + { + get + { + return ResourceManager.GetString("NoCloudsAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "There is no current context, please log in using Connect-AzAccount.". + /// + public static string NoCurrentContextForDataCmdlet + { + get + { + return ResourceManager.GetString("NoCurrentContextForDataCmdlet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeDirectory + { + get + { + return ResourceManager.GetString("NodeDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeEngineKey + { + get + { + return ResourceManager.GetString("NodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node.exe. + /// + public static string NodeExe + { + get + { + return ResourceManager.GetString("NodeExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name>. + /// + public static string NoDefaultSubscriptionMessage + { + get + { + return ResourceManager.GetString("NoDefaultSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft SDKs\Azure\Nodejs\Nov2011. + /// + public static string NodeModulesPath + { + get + { + return ResourceManager.GetString("NodeModulesPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeProgramFilesFolderName + { + get + { + return ResourceManager.GetString("NodeProgramFilesFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeRuntimeValue + { + get + { + return ResourceManager.GetString("NodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\Node. + /// + public static string NodeScaffolding + { + get + { + return ResourceManager.GetString("NodeScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node. + /// + public static string NodeScaffoldingResources + { + get + { + return ResourceManager.GetString("NodeScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}). + /// + public static string NodeVersionWarningText + { + get + { + return ResourceManager.GetString("NodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No, I do not agree. + /// + public static string NoHint + { + get + { + return ResourceManager.GetString("NoHint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. + /// + public static string NoInternetConnection + { + get + { + return ResourceManager.GetString("NoInternetConnection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <NONE>. + /// + public static string None + { + get + { + return ResourceManager.GetString("None", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No publish settings files with extension *.publishsettings are found in the directory "{0}".. + /// + public static string NoPublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("NoPublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no subscription associated with account {0}.. + /// + public static string NoSubscriptionAddedMessage + { + get + { + return ResourceManager.GetString("NoSubscriptionAddedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount?. + /// + public static string NoSubscriptionFoundForTenant + { + get + { + return ResourceManager.GetString("NoSubscriptionFoundForTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration.. + /// + public static string NotCacheWorkerRole + { + get + { + return ResourceManager.GetString("NotCacheWorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate can't be null.. + /// + public static string NullCertificateMessage + { + get + { + return ResourceManager.GetString("NullCertificateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} could not be null or empty. + /// + public static string NullObjectMessage + { + get + { + return ResourceManager.GetString("NullObjectMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add a null RoleSettings to {0}. + /// + public static string NullRoleSettingsMessage + { + get + { + return ResourceManager.GetString("NullRoleSettingsMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add new role to null service definition. + /// + public static string NullServiceDefinitionMessage + { + get + { + return ResourceManager.GetString("NullServiceDefinitionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request offer '{0}' is not found.. + /// + public static string OfferNotFoundMessage + { + get + { + return ResourceManager.GetString("OfferNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation "{0}" failed on VM with ID: {1}. + /// + public static string OperationFailedErrorMessage + { + get + { + return ResourceManager.GetString("OperationFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The REST operation failed with message '{0}' and error code '{1}'. + /// + public static string OperationFailedMessage + { + get + { + return ResourceManager.GetString("OperationFailedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state.. + /// + public static string OperationTimedOutOrError + { + get + { + return ResourceManager.GetString("OperationTimedOutOrError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package. + /// + public static string Package + { + get + { + return ResourceManager.GetString("Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Package is created at service root path {0}.. + /// + public static string PackageCreated + { + get + { + return ResourceManager.GetString("PackageCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {{ + /// "author": "", + /// + /// "name": "{0}", + /// "version": "0.0.0", + /// "dependencies":{{}}, + /// "devDependencies":{{}}, + /// "optionalDependencies": {{}}, + /// "engines": {{ + /// "node": "*", + /// "iisnode": "*" + /// }} + /// + ///}} + ///. + /// + public static string PackageJsonDefaultFile + { + get + { + return ResourceManager.GetString("PackageJsonDefaultFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package.json. + /// + public static string PackageJsonFileName + { + get + { + return ResourceManager.GetString("PackageJsonFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} doesn't exist.. + /// + public static string PathDoesNotExist + { + get + { + return ResourceManager.GetString("PathDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. + /// + public static string PathDoesNotExistForElement + { + get + { + return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Peer Asn has to be provided.. + /// + public static string PeerAsnRequired + { + get + { + return ResourceManager.GetString("PeerAsnRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 5.4.0. + /// + public static string PHPDefaultRuntimeVersion + { + get + { + return ResourceManager.GetString("PHPDefaultRuntimeVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to php. + /// + public static string PhpRuntimeValue + { + get + { + return ResourceManager.GetString("PhpRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\PHP. + /// + public static string PHPScaffolding + { + get + { + return ResourceManager.GetString("PHPScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP. + /// + public static string PHPScaffoldingResources + { + get + { + return ResourceManager.GetString("PHPScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}). + /// + public static string PHPVersionWarningText + { + get + { + return ResourceManager.GetString("PHPVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your first web site using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. At the bottom of the page, click on New > Web Site > Quick Create + ///2. Type {0} in the URL field + ///3. Click on "Create Web Site" + ///4. Once the site has been created, click on the site name + ///5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create.. + /// + public static string PortalInstructions + { + get + { + return ResourceManager.GetString("PortalInstructions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git". + /// + public static string PortalInstructionsGit + { + get + { + return ResourceManager.GetString("PortalInstructionsGit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. The functionality may not be available in the selected subscription. + /// + public static string PreviewCmdletMessage + { + get + { + return ResourceManager.GetString("PreviewCmdletMessage", resourceCulture); + } + } + + + /// + /// Looks up a localized string similar to A value for the Primary Peer Subnet has to be provided.. + /// + public static string PrimaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("PrimaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Promotion code can be used only when updating to a new plan.. + /// + public static string PromotionCodeWithCurrentPlanMessage + { + get + { + return ResourceManager.GetString("PromotionCodeWithCurrentPlanMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service not published at user request.. + /// + public static string PublishAbortedAtUserRequest + { + get + { + return ResourceManager.GetString("PublishAbortedAtUserRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete.. + /// + public static string PublishCompleteMessage + { + get + { + return ResourceManager.GetString("PublishCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connecting.... + /// + public static string PublishConnectingMessage + { + get + { + return ResourceManager.GetString("PublishConnectingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Deployment ID: {0}.. + /// + public static string PublishCreatedDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishCreatedDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created hosted service '{0}'.. + /// + public static string PublishCreatedServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatedServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Website URL: {0}.. + /// + public static string PublishCreatedWebsiteMessage + { + get + { + return ResourceManager.GetString("PublishCreatedWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating.... + /// + public static string PublishCreatingServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatingServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Initializing.... + /// + public static string PublishInitializingMessage + { + get + { + return ResourceManager.GetString("PublishInitializingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to busy. + /// + public static string PublishInstanceStatusBusy + { + get + { + return ResourceManager.GetString("PublishInstanceStatusBusy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to creating the virtual machine. + /// + public static string PublishInstanceStatusCreating + { + get + { + return ResourceManager.GetString("PublishInstanceStatusCreating", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instance {0} of role {1} is {2}.. + /// + public static string PublishInstanceStatusMessage + { + get + { + return ResourceManager.GetString("PublishInstanceStatusMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ready. + /// + public static string PublishInstanceStatusReady + { + get + { + return ResourceManager.GetString("PublishInstanceStatusReady", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing deployment for {0} with Subscription ID: {1}.... + /// + public static string PublishPreparingDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishPreparingDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publishing {0} to Microsoft Azure. This may take several minutes.... + /// + public static string PublishServiceStartMessage + { + get + { + return ResourceManager.GetString("PublishServiceStartMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publish settings. + /// + public static string PublishSettings + { + get + { + return ResourceManager.GetString("PublishSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure. + /// + public static string PublishSettingsElementName + { + get + { + return ResourceManager.GetString("PublishSettingsElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to .PublishSettings. + /// + public static string PublishSettingsFileExtention + { + get + { + return ResourceManager.GetString("PublishSettingsFileExtention", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publishSettings.xml. + /// + public static string PublishSettingsFileName + { + get + { + return ResourceManager.GetString("PublishSettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &whr={0}. + /// + public static string PublishSettingsFileRealmFormat + { + get + { + return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publish settings imported. + /// + public static string PublishSettingsSetSuccessfully + { + get + { + return ResourceManager.GetString("PublishSettingsSetSuccessfully", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PUBLISHINGPROFILE_URL. + /// + public static string PublishSettingsUrlEnv + { + get + { + return ResourceManager.GetString("PublishSettingsUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting.... + /// + public static string PublishStartingMessage + { + get + { + return ResourceManager.GetString("PublishStartingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upgrading.... + /// + public static string PublishUpgradingMessage + { + get + { + return ResourceManager.GetString("PublishUpgradingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uploading Package to storage service {0}.... + /// + public static string PublishUploadingPackageMessage + { + get + { + return ResourceManager.GetString("PublishUploadingPackageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verifying storage account '{0}'.... + /// + public static string PublishVerifyingStorageMessage + { + get + { + return ResourceManager.GetString("PublishVerifyingStorageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionAdditionalContentPathNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionAdditionalContentPathNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration published to {0}. + /// + public static string PublishVMDscExtensionArchiveUploadedMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionArchiveUploadedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyFileVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyFileVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy the module '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyModuleVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyModuleVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1).. + /// + public static string PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleted '{0}'. + /// + public static string PublishVMDscExtensionDeletedFileMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeletedFileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot delete '{0}': {1}. + /// + public static string PublishVMDscExtensionDeleteErrorMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeleteErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionDirectoryNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDirectoryNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot get module for DscResource '{0}'. Possible solutions: + ///1) Specify -ModuleName for Import-DscResource in your configuration. + ///2) Unblock module that contains resource. + ///3) Move Import-DscResource inside Node block. + ///. + /// + public static string PublishVMDscExtensionGetDscResourceFailed + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionGetDscResourceFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List of required modules: [{0}].. + /// + public static string PublishVMDscExtensionRequiredModulesVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredModulesVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version.. + /// + public static string PublishVMDscExtensionRequiredPsVersion + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredPsVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration script '{0}' contained parse errors: + ///{1}. + /// + public static string PublishVMDscExtensionStorageParserErrors + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionStorageParserErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Temp folder '{0}' created.. + /// + public static string PublishVMDscExtensionTempFolderVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionTempFolderVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip).. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration file '{0}' not found.. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. + ///Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enab [rest of string was truncated]";. + /// + public static string RDFEDataCollectionMessage + { + get + { + return ResourceManager.GetString("RDFEDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replace current deployment with '{0}' Id ?. + /// + public static string RedeployCommit + { + get + { + return ResourceManager.GetString("RedeployCommit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to regenerate key?. + /// + public static string RegenerateKeyWarning + { + get + { + return ResourceManager.GetString("RegenerateKeyWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Generate new key.. + /// + public static string RegenerateKeyWhatIfMessage + { + get + { + return ResourceManager.GetString("RegenerateKeyWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove account '{0}'?. + /// + public static string RemoveAccountConfirmation + { + get + { + return ResourceManager.GetString("RemoveAccountConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing account. + /// + public static string RemoveAccountMessage + { + get + { + return ResourceManager.GetString("RemoveAccountMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove Add-On Confirmation. + /// + public static string RemoveAddOnConformation + { + get + { + return ResourceManager.GetString("RemoveAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm.. + /// + public static string RemoveAddOnMessage + { + get + { + return ResourceManager.GetString("RemoveAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureBGPPeering Operation failed.. + /// + public static string RemoveAzureBGPPeeringFailed + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Bgp Peering. + /// + public static string RemoveAzureBGPPeeringMessage + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Bgp Peering with Service Key {0}.. + /// + public static string RemoveAzureBGPPeeringSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Bgp Peering with service key '{0}'?. + /// + public static string RemoveAzureBGPPeeringWarning + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit with service key '{0}'?. + /// + public static string RemoveAzureDedicatdCircuitWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatdCircuitWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuit Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuitLink Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitLinkFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circui Link. + /// + public static string RemoveAzureDedicatedCircuitLinkMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1}. + /// + public static string RemoveAzureDedicatedCircuitLinkSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'?. + /// + public static string RemoveAzureDedicatedCircuitLinkWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circuit. + /// + public static string RemoveAzureDedicatedCircuitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit with Service Key {0}.. + /// + public static string RemoveAzureDedicatedCircuitSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing cloud service {0}.... + /// + public static string RemoveAzureServiceWaitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureServiceWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription.. + /// + public static string RemoveDefaultSubscription + { + get + { + return ResourceManager.GetString("RemoveDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing {0} deployment for {1} service. + /// + public static string RemoveDeploymentWaitMessage + { + get + { + return ResourceManager.GetString("RemoveDeploymentWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'?. + /// + public static string RemoveEnvironmentConfirmation + { + get + { + return ResourceManager.GetString("RemoveEnvironmentConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing environment. + /// + public static string RemoveEnvironmentMessage + { + get + { + return ResourceManager.GetString("RemoveEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job collection. + /// + public static string RemoveJobCollectionMessage + { + get + { + return ResourceManager.GetString("RemoveJobCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job collection "{0}". + /// + public static string RemoveJobCollectionWarning + { + get + { + return ResourceManager.GetString("RemoveJobCollectionWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job. + /// + public static string RemoveJobMessage + { + get + { + return ResourceManager.GetString("RemoveJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job "{0}". + /// + public static string RemoveJobWarning + { + get + { + return ResourceManager.GetString("RemoveJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the account?. + /// + public static string RemoveMediaAccountWarning + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account removed.. + /// + public static string RemoveMediaAccountWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription.. + /// + public static string RemoveNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("RemoveNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing old package {0}.... + /// + public static string RemovePackage + { + get + { + return ResourceManager.GetString("RemovePackage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile?. + /// + public static string RemoveProfileConfirmation + { + get + { + return ResourceManager.GetString("RemoveProfileConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile. + /// + public static string RemoveProfileMessage + { + get + { + return ResourceManager.GetString("RemoveProfileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the namespace '{0}'?. + /// + public static string RemoveServiceBusNamespaceConfirmation + { + get + { + return ResourceManager.GetString("RemoveServiceBusNamespaceConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove cloud service?. + /// + public static string RemoveServiceWarning + { + get + { + return ResourceManager.GetString("RemoveServiceWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove cloud service and all it's deployments. + /// + public static string RemoveServiceWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveServiceWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove subscription '{0}'?. + /// + public static string RemoveSubscriptionConfirmation + { + get + { + return ResourceManager.GetString("RemoveSubscriptionConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing subscription. + /// + public static string RemoveSubscriptionMessage + { + get + { + return ResourceManager.GetString("RemoveSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The endpoint {0} cannot be removed from profile {1} because it's not in the profile.. + /// + public static string RemoveTrafficManagerEndpointMissing + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerEndpointMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureTrafficManagerProfile Operation failed.. + /// + public static string RemoveTrafficManagerProfileFailed + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Traffic Manager profile with name {0}.. + /// + public static string RemoveTrafficManagerProfileSucceeded + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Traffic Manager profile "{0}"?. + /// + public static string RemoveTrafficManagerProfileWarning + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the VM '{0}'?. + /// + public static string RemoveVMConfirmationMessage + { + get + { + return ResourceManager.GetString("RemoveVMConfirmationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting VM.. + /// + public static string RemoveVMMessage + { + get + { + return ResourceManager.GetString("RemoveVMMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing WebJob.... + /// + public static string RemoveWebJobMessage + { + get + { + return ResourceManager.GetString("RemoveWebJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove job '{0}'?. + /// + public static string RemoveWebJobWarning + { + get + { + return ResourceManager.GetString("RemoveWebJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing website. + /// + public static string RemoveWebsiteMessage + { + get + { + return ResourceManager.GetString("RemoveWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the website "{0}". + /// + public static string RemoveWebsiteWarning + { + get + { + return ResourceManager.GetString("RemoveWebsiteWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing public environment is not supported.. + /// + public static string RemovingDefaultEnvironmentsNotSupported + { + get + { + return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting namespace. + /// + public static string RemovingNamespaceMessage + { + get + { + return ResourceManager.GetString("RemovingNamespaceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repository is not setup. You need to pass a valid site name.. + /// + public static string RepositoryNotSetup + { + get + { + return ResourceManager.GetString("RepositoryNotSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use.. + /// + public static string ReservedIPNameNoLongerInUseButStillBeingReserved + { + get + { + return ResourceManager.GetString("ReservedIPNameNoLongerInUseButStillBeingReserved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource with ID : {0} does not exist.. + /// + public static string ResourceNotFound + { + get + { + return ResourceManager.GetString("ResourceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Restart. + /// + public static string Restart + { + get + { + return ResourceManager.GetString("Restart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resume. + /// + public static string Resume + { + get + { + return ResourceManager.GetString("Resume", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /role:{0};"{1}/{0}" . + /// + public static string RoleArgTemplate + { + get + { + return ResourceManager.GetString("RoleArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to bin. + /// + public static string RoleBinFolderName + { + get + { + return ResourceManager.GetString("RoleBinFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} is {1}. + /// + public static string RoleInstanceWaitMsg + { + get + { + return ResourceManager.GetString("RoleInstanceWaitMsg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 20. + /// + public static string RoleMaxInstances + { + get + { + return ResourceManager.GetString("RoleMaxInstances", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to role name. + /// + public static string RoleName + { + get + { + return ResourceManager.GetString("RoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name {0} doesn't exist. + /// + public static string RoleNotFoundMessage + { + get + { + return ResourceManager.GetString("RoleNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RoleSettings.xml. + /// + public static string RoleSettingsTemplateFileName + { + get + { + return ResourceManager.GetString("RoleSettingsTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role type {0} doesn't exist. + /// + public static string RoleTypeDoesNotExist + { + get + { + return ResourceManager.GetString("RoleTypeDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to public static Dictionary<string, Location> ReverseLocations { get; private set; }. + /// + public static string RuntimeDeploymentLocationError + { + get + { + return ResourceManager.GetString("RuntimeDeploymentLocationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing runtime deployment for service '{0}'. + /// + public static string RuntimeDeploymentStart + { + get + { + return ResourceManager.GetString("RuntimeDeploymentStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version?. + /// + public static string RuntimeMismatchWarning + { + get + { + return ResourceManager.GetString("RuntimeMismatchWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEOVERRIDEURL. + /// + public static string RuntimeOverrideKey + { + get + { + return ResourceManager.GetString("RuntimeOverrideKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /runtimemanifest/runtimes/runtime. + /// + public static string RuntimeQuery + { + get + { + return ResourceManager.GetString("RuntimeQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEID. + /// + public static string RuntimeTypeKey + { + get + { + return ResourceManager.GetString("RuntimeTypeKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEURL. + /// + public static string RuntimeUrlKey + { + get + { + return ResourceManager.GetString("RuntimeUrlKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEVERSIONPRIMARYKEY. + /// + public static string RuntimeVersionPrimaryKey + { + get + { + return ResourceManager.GetString("RuntimeVersionPrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to scaffold.xml. + /// + public static string ScaffoldXml + { + get + { + return ResourceManager.GetString("ScaffoldXml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation. + /// + public static string SchedulerInvalidLocation + { + get + { + return ResourceManager.GetString("SchedulerInvalidLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Secondary Peer Subnet has to be provided.. + /// + public static string SecondaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("SecondaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} already exists on disk in location {1}. + /// + public static string ServiceAlreadyExistsOnDisk + { + get + { + return ResourceManager.GetString("ServiceAlreadyExistsOnDisk", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No ServiceBus authorization rule with the given characteristics was found. + /// + public static string ServiceBusAuthorizationRuleNotFound + { + get + { + return ResourceManager.GetString("ServiceBusAuthorizationRuleNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service bus entity '{0}' is not found.. + /// + public static string ServiceBusEntityTypeNotFound + { + get + { + return ResourceManager.GetString("ServiceBusEntityTypeNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen due to an incorrect/missing namespace. + /// + public static string ServiceBusNamespaceMissingMessage + { + get + { + return ResourceManager.GetString("ServiceBusNamespaceMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service configuration. + /// + public static string ServiceConfiguration + { + get + { + return ResourceManager.GetString("ServiceConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service definition. + /// + public static string ServiceDefinition + { + get + { + return ResourceManager.GetString("ServiceDefinition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceDefinition.csdef. + /// + public static string ServiceDefinitionFileName + { + get + { + return ResourceManager.GetString("ServiceDefinitionFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}Deploy. + /// + public static string ServiceDeploymentName + { + get + { + return ResourceManager.GetString("ServiceDeploymentName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified cloud service "{0}" does not exist.. + /// + public static string ServiceDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is in {2} state, please wait until it finish and update it's status. + /// + public static string ServiceIsInTransitionState + { + get + { + return ResourceManager.GetString("ServiceIsInTransitionState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}.". + /// + public static string ServiceManagementClientExceptionStringFormat + { + get + { + return ResourceManager.GetString("ServiceManagementClientExceptionStringFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service name. + /// + public static string ServiceName + { + get + { + return ResourceManager.GetString("ServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. + /// + public static string ServiceNameExists + { + get + { + return ResourceManager.GetString("ServiceNameExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide name for the hosted service. + /// + public static string ServiceNameMissingMessage + { + get + { + return ResourceManager.GetString("ServiceNameMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service parent directory. + /// + public static string ServiceParentDirectory + { + get + { + return ResourceManager.GetString("ServiceParentDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} removed successfully. + /// + public static string ServiceRemovedMessage + { + get + { + return ResourceManager.GetString("ServiceRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service directory. + /// + public static string ServiceRoot + { + get + { + return ResourceManager.GetString("ServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service settings. + /// + public static string ServiceSettings + { + get + { + return ResourceManager.GetString("ServiceSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.. + /// + public static string ServiceSettings_ValidateStorageAccountName_InvalidName + { + get + { + return ResourceManager.GetString("ServiceSettings_ValidateStorageAccountName_InvalidName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for cloud service {1} doesn't exist.. + /// + public static string ServiceSlotDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceSlotDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is {2}. + /// + public static string ServiceStatusChanged + { + get + { + return ResourceManager.GetString("ServiceStatusChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set Add-On Confirmation. + /// + public static string SetAddOnConformation + { + get + { + return ResourceManager.GetString("SetAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} does not contain endpoint {1}. Adding it.. + /// + public static string SetInexistentTrafficManagerEndpointMessage + { + get + { + return ResourceManager.GetString("SetInexistentTrafficManagerEndpointMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string SetMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at <url> and (c) agree to sharing my contact information with {2}.. + /// + public static string SetNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances are set to {1}. + /// + public static string SetRoleInstancesMessage + { + get + { + return ResourceManager.GetString("SetRoleInstancesMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"Slot":"","Location":"","Subscription":"","StorageAccountName":""}. + /// + public static string SettingsFileEmptyContent + { + get + { + return ResourceManager.GetString("SettingsFileEmptyContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to deploymentSettings.json. + /// + public static string SettingsFileName + { + get + { + return ResourceManager.GetString("SettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insufficient parameters passed to create a new endpoint.. + /// + public static string SetTrafficManagerEndpointNeedsParameters + { + get + { + return ResourceManager.GetString("SetTrafficManagerEndpointNeedsParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ambiguous operation: the profile name specified doesn't match the name of the profile object.. + /// + public static string SetTrafficManagerProfileAmbiguous + { + get + { + return ResourceManager.GetString("SetTrafficManagerProfileAmbiguous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts.. + /// + public static string ShouldContinueFail + { + get + { + return ResourceManager.GetString("ShouldContinueFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm. + /// + public static string ShouldProcessCaption + { + get + { + return ResourceManager.GetString("ShouldProcessCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailConfirm + { + get + { + return ResourceManager.GetString("ShouldProcessFailConfirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again.. + /// + public static string ShouldProcessFailImpact + { + get + { + return ResourceManager.GetString("ShouldProcessFailImpact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailWhatIf + { + get + { + return ResourceManager.GetString("ShouldProcessFailWhatIf", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shutdown. + /// + public static string Shutdown + { + get + { + return ResourceManager.GetString("Shutdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /sites:{0};{1};"{2}/{0}" . + /// + public static string SitesArgTemplate + { + get + { + return ResourceManager.GetString("SitesArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string StandardRetryDelayInMs + { + get + { + return ResourceManager.GetString("StandardRetryDelayInMs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start. + /// + public static string Start + { + get + { + return ResourceManager.GetString("Start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Started. + /// + public static string StartedEmulator + { + get + { + return ResourceManager.GetString("StartedEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting Emulator.... + /// + public static string StartingEmulator + { + get + { + return ResourceManager.GetString("StartingEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to start. + /// + public static string StartStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StartStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop. + /// + public static string Stop + { + get + { + return ResourceManager.GetString("Stop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopping emulator.... + /// + public static string StopEmulatorMessage + { + get + { + return ResourceManager.GetString("StopEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopped. + /// + public static string StoppedEmulatorMessage + { + get + { + return ResourceManager.GetString("StoppedEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to stop. + /// + public static string StopStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StopStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Name:. + /// + public static string StorageAccountName + { + get + { + return ResourceManager.GetString("StorageAccountName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find storage account '{0}' please type the name of an existing storage account.. + /// + public static string StorageAccountNotFound + { + get + { + return ResourceManager.GetString("StorageAccountNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureStorageEmulator.exe. + /// + public static string StorageEmulatorExe + { + get + { + return ResourceManager.GetString("StorageEmulatorExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to InstallPath. + /// + public static string StorageEmulatorInstallPathRegistryKeyValue + { + get + { + return ResourceManager.GetString("StorageEmulatorInstallPathRegistryKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SOFTWARE\Microsoft\Windows Azure Storage Emulator. + /// + public static string StorageEmulatorRegistryKey + { + get + { + return ResourceManager.GetString("StorageEmulatorRegistryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary Key:. + /// + public static string StoragePrimaryKey + { + get + { + return ResourceManager.GetString("StoragePrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Secondary Key:. + /// + public static string StorageSecondaryKey + { + get + { + return ResourceManager.GetString("StorageSecondaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} already exists.. + /// + public static string SubscriptionAlreadyExists + { + get + { + return ResourceManager.GetString("SubscriptionAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information.. + /// + public static string SubscriptionDataFileDeprecated + { + get + { + return ResourceManager.GetString("SubscriptionDataFileDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DefaultSubscriptionData.xml. + /// + public static string SubscriptionDataFileName + { + get + { + return ResourceManager.GetString("SubscriptionDataFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription data file {0} does not exist.. + /// + public static string SubscriptionDataFileNotFound + { + get + { + return ResourceManager.GetString("SubscriptionDataFileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription id {0} doesn't exist.. + /// + public static string SubscriptionIdNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription must not be null. + /// + public static string SubscriptionMustNotBeNull + { + get + { + return ResourceManager.GetString("SubscriptionMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription name needs to be specified.. + /// + public static string SubscriptionNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription name {0} doesn't exist.. + /// + public static string SubscriptionNameNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription needs to be specified.. + /// + public static string SubscriptionNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Suspend. + /// + public static string Suspend + { + get + { + return ResourceManager.GetString("Suspend", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Swapping website production slot .... + /// + public static string SwappingWebsite + { + get + { + return ResourceManager.GetString("SwappingWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to swap the website '{0}' production slot with slot '{1}'?. + /// + public static string SwapWebsiteSlotWarning + { + get + { + return ResourceManager.GetString("SwapWebsiteSlotWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.. + /// + public static string SwitchAzureModeDeprecated + { + get + { + return ResourceManager.GetString("SwitchAzureModeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}'. + /// + public static string TraceBeginLROJob + { + get + { + return ResourceManager.GetString("TraceBeginLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}'. + /// + public static string TraceBlockLROThread + { + get + { + return ResourceManager.GetString("TraceBlockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Completing cmdlet execution in RunJob. + /// + public static string TraceEndLROJob + { + get + { + return ResourceManager.GetString("TraceEndLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}'. + /// + public static string TraceHandleLROStateChange + { + get + { + return ResourceManager.GetString("TraceHandleLROStateChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job due to stoppage or failure. + /// + public static string TraceHandlerCancelJob + { + get + { + return ResourceManager.GetString("TraceHandlerCancelJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job that was previously blocked.. + /// + public static string TraceHandlerUnblockJob + { + get + { + return ResourceManager.GetString("TraceHandlerUnblockJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Error in cmdlet execution. + /// + public static string TraceLROJobException + { + get + { + return ResourceManager.GetString("TraceLROJobException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Removing state changed event handler, exception '{0}'. + /// + public static string TraceRemoveLROEventHandler + { + get + { + return ResourceManager.GetString("TraceRemoveLROEventHandler", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: ShouldMethod '{0}' unblocked.. + /// + public static string TraceUnblockLROThread + { + get + { + return ResourceManager.GetString("TraceUnblockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}.. + /// + public static string UnableToDecodeBase64String + { + get + { + return ResourceManager.GetString("UnableToDecodeBase64String", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. + /// + public static string UnableToPatchJson + { + get + { + return ResourceManager.GetString("UnableToPatchJson", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provider {0} is unknown.. + /// + public static string UnknownProviderMessage + { + get + { + return ResourceManager.GetString("UnknownProviderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string Update + { + get + { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updated settings for subscription '{0}'. Current subscription is '{1}'.. + /// + public static string UpdatedSettings + { + get + { + return ResourceManager.GetString("UpdatedSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name is not valid.. + /// + public static string UserNameIsNotValid + { + get + { + return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name needs to be specified.. + /// + public static string UserNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the VLan Id has to be provided.. + /// + public static string VlanIdRequired + { + get + { + return ResourceManager.GetString("VlanIdRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please wait.... + /// + public static string WaitMessage + { + get + { + return ResourceManager.GetString("WaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The azure storage emulator is not installed, skip launching.... + /// + public static string WarningWhenStorageEmulatorIsMissing + { + get + { + return ResourceManager.GetString("WarningWhenStorageEmulatorIsMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Web.cloud.config. + /// + public static string WebCloudConfig + { + get + { + return ResourceManager.GetString("WebCloudConfig", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to web.config. + /// + public static string WebConfigTemplateFileName + { + get + { + return ResourceManager.GetString("WebConfigTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MSDeploy. + /// + public static string WebDeployKeywordInWebSitePublishProfile + { + get + { + return ResourceManager.GetString("WebDeployKeywordInWebSitePublishProfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot build the project successfully. Please see logs in {0}.. + /// + public static string WebProjectBuildFailTemplate + { + get + { + return ResourceManager.GetString("WebProjectBuildFailTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole. + /// + public static string WebRole + { + get + { + return ResourceManager.GetString("WebRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_web.cmd > log.txt. + /// + public static string WebRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WebRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole.xml. + /// + public static string WebRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WebRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Webspace.. + /// + public static string WebsiteAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Location.. + /// + public static string WebsiteAlreadyExistsReplacement + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExistsReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Site {0} already has repository created for it.. + /// + public static string WebsiteRepositoryAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteRepositoryAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workspaces/WebsiteExtension/Website/{0}/dashboard/. + /// + public static string WebsiteSufixUrl + { + get + { + return ResourceManager.GetString("WebsiteSufixUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}/msdeploy.axd?site={1}. + /// + public static string WebSiteWebDeployUriTemplate + { + get + { + return ResourceManager.GetString("WebSiteWebDeployUriTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole. + /// + public static string WorkerRole + { + get + { + return ResourceManager.GetString("WorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_worker.cmd > log.txt. + /// + public static string WorkerRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WorkerRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole.xml. + /// + public static string WorkerRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WorkerRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (x86). + /// + public static string x86InProgramFiles + { + get + { + return ResourceManager.GetString("x86InProgramFiles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + public static string Yes + { + get + { + return ResourceManager.GetString("Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes, I agree. + /// + public static string YesHint + { + get + { + return ResourceManager.GetString("YesHint", resourceCulture); + } + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/Properties/Resources.resx b/swaggerci/cost-management/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..598cd53e958a --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Properties/Resources.resx @@ -0,0 +1,1741 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The remote server returned an error: (401) Unauthorized. + + + Account "{0}" has been added. + + + To switch to a different subscription, please use Select-AzureSubscription. + + + Subscription "{0}" is selected as the default subscription. + + + To view all the subscriptions, please use Get-AzureSubscription. + + + Add-On {0} is created successfully. + + + Add-on name {0} is already used. + + + Add-On {0} not found. + + + Add-on {0} is removed successfully. + + + Add-On {0} is updated successfully. + + + Role has been created at {0}\{1}. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure". + + + Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator + + + A role name '{0}' already exists + + + Windows Azure Powershell\ + + + https://manage.windowsazure.com + + + AZURE_PORTAL_URL + + + Azure SDK\{0}\ + + + Base Uri was empty. + WAPackIaaS + + + {0} begin processing without ParameterSet. + + + {0} begin processing with ParameterSet '{1}'. + + + Blob with the name {0} already exists in the account. + + + https://{0}.blob.core.windows.net/ + + + AZURE_BLOBSTORAGE_TEMPLATE + + + CACHERUNTIMEURL + + + cache + + + CacheRuntimeVersion + + + Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}) + + + Cannot find {0} with name {1}. + + + Deployment for service {0} with {1} slot doesn't exist + + + Can't find valid Microsoft Azure role in current directory {0} + + + service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist + + + Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders. + + + The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated. + + + ManagementCertificate + + + certificate.pfx + + + Certificate imported into CurrentUser\My\{0} + + + Your account does not have access to the private key for certificate {0} + + + {0} {1} deployment for {2} service + + + Cloud service {0} is in {1} state. + + + Changing/Removing public environment '{0}' is not allowed. + + + Service {0} is set to value {1} + + + Choose which publish settings file to use: + + + Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel + + + 1 + + + cloud_package.cspkg + + + ServiceConfiguration.Cloud.cscfg + + + Add-ons for {0} + + + Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive. + + + Complete + + + config.json + + + VirtualMachine creation failed. + WAPackIaaS + + + Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead. + + + Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core + + + //blobcontainer[@datacenter='{0}'] + + + Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription + + + none + + + There are no hostnames which could be used for validation. + + + 8080 + + + 1000 + + + Auto + + + 80 + + + Delete + WAPackIaaS + + + The {0} slot for service {1} is already in {2} state + + + The deployment in {0} slot for service {1} is removed + + + Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel + + + 1 + + + The key to add already exists in the dictionary. + + + The array index cannot be less than zero. + + + The supplied array does not have enough room to contain the copied elements. + + + The provided dns {0} doesn't exist + + + Microsoft Azure Certificate + + + Endpoint can't be retrieved for storage account + + + {0} end processing. + + + To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet. + + + The environment '{0}' already exists. + + + environments.xml + + + Error creating VirtualMachine + WAPackIaaS + + + Unable to download available runtimes for location '{0}' + + + Error updating VirtualMachine + WAPackIaaS + + + Job Id {0} failed. Error: {1}, ExceptionDetails: {2} + WAPackIaaS + + + The HTTP request was forbidden with client authentication scheme 'Anonymous'. + + + This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell. + + + Operation Status: + + + Resources\Scaffolding\General + + + Getting all available Microsoft Azure Add-Ons, this may take few minutes... + + + Name{0}Primary Key{0}Seconday Key + + + Git not found. Please install git and place it in your command line path. + + + Could not find publish settings. Please run Import-AzurePublishSettingsFile. + + + iisnode.dll + + + iisnode + + + iisnode-dev\\release\\x64 + + + iisnode + + + Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}) + + + Internal Server Error + + + Cannot enable memcach protocol on a cache worker role {0}. + + + Invalid certificate format. + + + The provided configuration path is invalid or doesn't exist + + + The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2. + + + Deployment with {0} does not exist + + + The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production". + + + Invalid service endpoint. + + + File {0} has invalid characters + + + You must create your git publishing credentials using the Microsoft Azure portal. +Please follow these steps in the portal: +1. On the left side open "Web Sites" +2. Click on any website +3. Choose "Setup Git Publishing" or "Reset deployment credentials" +4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username} + + + The value {0} provided is not a valid GUID. Please provide a valid GUID. + + + The specified hostname does not exist. Please specify a valid hostname for the site. + + + Role {0} instances must be greater than or equal 0 and less than or equal 20 + + + There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file. + + + Could not download a valid runtime manifest, Please check your internet connection and try again. + + + The account {0} was not found. Please specify a valid account name. + + + The provided name "{0}" does not match the service bus namespace naming rules. + + + Value cannot be null. Parameter name: '{0}' + + + The provided package path is invalid or doesn't exist + + + '{0}' is an invalid parameter set name. + + + {0} doesn't exist in {1} or you've not passed valid value for it + + + Path {0} has invalid characters + + + The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile + + + The provided role name "{0}" has invalid characters + + + A valid name for the service root folder is required + + + {0} is not a recognized runtime type + + + A valid language is required + + + No subscription is currently selected. Use Select-Subscription to activate a subscription. + + + The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations. + + + Please provide a service name or run this command from inside a service project directory. + + + You must provide valid value for {0} + + + settings.json is invalid or doesn't exist + + + The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data. + + + The provided subscription id {0} is not valid + + + A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet + + + The provided subscriptions file {0} has invalid content. + + + Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge. + + + The web job file must have *.zip extension + + + Singleton option works for continuous jobs only. + + + The website {0} was not found. Please specify a valid website name. + + + No job for id: {0} was found. + WAPackIaaS + + + engines + + + Scaffolding for this language is not yet supported + + + Link already established + + + local_package.csx + + + ServiceConfiguration.Local.cscfg + + + Looking for {0} deployment for {1} cloud service... + + + Looking for cloud service {0}... + + + managementCertificate.pem + + + ?whr={0} + + + //baseuri + + + uri + + + http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml + + + Multiple Add-Ons found holding name {0} + + + Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername. + + + The first publish settings file "{0}" is used. If you want to use another file specify the file name. + + + Microsoft.WindowsAzure.Plugins.Caching.NamedCaches + + + {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]} + + + A publishing username is required. Please specify one using the argument PublishingUsername. + + + New Add-On Confirmation + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names. + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at {0} and (c) agree to sharing my contact information with {2}. + + + Service has been created at {0} + + + No + + + There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription. + + + The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole. + + + No clouds available + WAPackIaaS + + + nodejs + + + node + + + node.exe + + + There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name> + + + Microsoft SDKs\Azure\Nodejs\Nov2011 + + + nodejs + + + node + + + Resources\Scaffolding\Node + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node + + + Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}) + + + No, I do not agree + + + No publish settings files with extension *.publishsettings are found in the directory "{0}". + + + '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration. + + + Certificate can't be null. + + + {0} could not be null or empty + + + Unable to add a null RoleSettings to {0} + + + Unable to add new role to null service definition + + + The request offer '{0}' is not found. + + + Operation "{0}" failed on VM with ID: {1} + WAPackIaaS + + + The REST operation failed with message '{0}' and error code '{1}' + + + Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state. + WAPackIaaS + + + package + + + Package is created at service root path {0}. + + + {{ + "author": "", + + "name": "{0}", + "version": "0.0.0", + "dependencies":{{}}, + "devDependencies":{{}}, + "optionalDependencies": {{}}, + "engines": {{ + "node": "*", + "iisnode": "*" + }} + +}} + + + + package.json + + + A value for the Peer Asn has to be provided. + + + 5.4.0 + + + php + + + Resources\Scaffolding\PHP + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP + + + Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}) + + + You must create your first web site using the Microsoft Azure portal. +Please follow these steps in the portal: +1. At the bottom of the page, click on New > Web Site > Quick Create +2. Type {0} in the URL field +3. Click on "Create Web Site" +4. Once the site has been created, click on the site name +5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create. + + + 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git" + + + A value for the Primary Peer Subnet has to be provided. + + + Promotion code can be used only when updating to a new plan. + + + Service not published at user request. + + + Complete. + + + Connecting... + + + Created Deployment ID: {0}. + + + Created hosted service '{0}'. + + + Created Website URL: {0}. + + + Creating... + + + Initializing... + + + busy + + + creating the virtual machine + + + Instance {0} of role {1} is {2}. + + + ready + + + Preparing deployment for {0} with Subscription ID: {1}... + + + Publishing {0} to Microsoft Azure. This may take several minutes... + + + publish settings + + + Azure + + + .PublishSettings + + + publishSettings.xml + + + Publish settings imported + + + AZURE_PUBLISHINGPROFILE_URL + + + Starting... + + + Upgrading... + + + Uploading Package to storage service {0}... + + + Verifying storage account '{0}'... + + + Replace current deployment with '{0}' Id ? + + + Are you sure you want to regenerate key? + + + Generate new key. + + + Are you sure you want to remove account '{0}'? + + + Removing account + + + Remove Add-On Confirmation + + + If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm. + + + Remove-AzureBGPPeering Operation failed. + + + Removing Bgp Peering + + + Successfully removed Azure Bgp Peering with Service Key {0}. + + + Are you sure you want to remove the Bgp Peering with service key '{0}'? + + + Are you sure you want to remove the Dedicated Circuit with service key '{0}'? + + + Remove-AzureDedicatedCircuit Operation failed. + + + Remove-AzureDedicatedCircuitLink Operation failed. + + + Removing Dedicated Circui Link + + + Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1} + + + Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'? + + + Removing Dedicated Circuit + + + Successfully removed Azure Dedicated Circuit with Service Key {0}. + + + Removing cloud service {0}... + + + Removing {0} deployment for {1} service + + + Removing job collection + + + Are you sure you want to remove the job collection "{0}" + + + Removing job + + + Are you sure you want to remove the job "{0}" + + + Are you sure you want to remove the account? + + + Account removed. + + + Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription. + + + Removing old package {0}... + + + Are you sure you want to delete the namespace '{0}'? + + + Are you sure you want to remove cloud service? + + + Remove cloud service and all it's deployments + + + Are you sure you want to remove subscription '{0}'? + + + Removing subscription + + + Are you sure you want to delete the VM '{0}'? + + + Deleting VM. + + + Removing WebJob... + + + Are you sure you want to remove job '{0}'? + + + Removing website + + + Are you sure you want to remove the website "{0}" + + + Deleting namespace + + + Repository is not setup. You need to pass a valid site name. + + + Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use. + + + Resource with ID : {0} does not exist. + WAPackIaaS + + + Restart + WAPackIaaS + + + Resume + WAPackIaaS + + + /role:{0};"{1}/{0}" + + + bin + + + Role {0} is {1} + + + 20 + + + role name + + + The provided role name {0} doesn't exist + + + RoleSettings.xml + + + Role type {0} doesn't exist + + + public static Dictionary<string, Location> ReverseLocations { get; private set; } + + + Preparing runtime deployment for service '{0}' + + + WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version? + + + RUNTIMEOVERRIDEURL + + + /runtimemanifest/runtimes/runtime + + + RUNTIMEID + + + RUNTIMEURL + + + RUNTIMEVERSIONPRIMARYKEY + + + scaffold.xml + + + Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation + + + A value for the Secondary Peer Subnet has to be provided. + + + Service {0} already exists on disk in location {1} + + + No ServiceBus authorization rule with the given characteristics was found + + + The service bus entity '{0}' is not found. + + + Internal Server Error. This could happen due to an incorrect/missing namespace + + + service configuration + + + service definition + + + ServiceDefinition.csdef + + + {0}Deploy + + + The specified cloud service "{0}" does not exist. + + + {0} slot for service {1} is in {2} state, please wait until it finish and update it's status + + + Begin Operation: {0} + + + Completed Operation: {0} + + + Begin Operation: {0} + + + Completed Operation: {0} + + + service name + + + Please provide name for the hosted service + + + service parent directory + + + Service {0} removed successfully + + + service directory + + + service settings + + + The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + + + The {0} slot for cloud service {1} doesn't exist. + + + {0} slot for service {1} is {2} + + + Set Add-On Confirmation + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at <url> and (c) agree to sharing my contact information with {2}. + + + Role {0} instances are set to {1} + + + {"Slot":"","Location":"","Subscription":"","StorageAccountName":""} + + + deploymentSettings.json + + + Confirm + + + Shutdown + WAPackIaaS + + + /sites:{0};{1};"{2}/{0}" + + + 1000 + + + Start + WAPackIaaS + + + Started + + + Starting Emulator... + + + start + + + Stop + WAPackIaaS + + + Stopping emulator... + + + Stopped + + + stop + + + Account Name: + + + Cannot find storage account '{0}' please type the name of an existing storage account. + + + AzureStorageEmulator.exe + + + InstallPath + + + SOFTWARE\Microsoft\Windows Azure Storage Emulator + + + Primary Key: + + + Secondary Key: + + + The subscription named {0} already exists. + + + DefaultSubscriptionData.xml + + + The subscription data file {0} does not exist. + + + Subscription must not be null + WAPackIaaS + + + Suspend + WAPackIaaS + + + Swapping website production slot ... + + + Are you sure you want to swap the website '{0}' production slot with slot '{1}'? + + + The provider {0} is unknown. + + + Update + WAPackIaaS + + + Updated settings for subscription '{0}'. Current subscription is '{1}'. + + + A value for the VLan Id has to be provided. + + + Please wait... + + + The azure storage emulator is not installed, skip launching... + + + Web.cloud.config + + + web.config + + + MSDeploy + + + Cannot build the project successfully. Please see logs in {0}. + + + WebRole + + + setup_web.cmd > log.txt + + + WebRole.xml + + + WebSite with given name {0} already exists in the specified Subscription and Webspace. + + + WebSite with given name {0} already exists in the specified Subscription and Location. + + + Site {0} already has repository created for it. + + + Workspaces/WebsiteExtension/Website/{0}/dashboard/ + + + https://{0}/msdeploy.axd?site={1} + + + WorkerRole + + + setup_worker.cmd > log.txt + + + WorkerRole.xml + + + Yes + + + Yes, I agree + + + Remove-AzureTrafficManagerProfile Operation failed. + + + Successfully removed Traffic Manager profile with name {0}. + + + Are you sure you want to remove the Traffic Manager profile "{0}"? + + + Profile {0} already has an endpoint with name {1} + + + Profile {0} does not contain endpoint {1}. Adding it. + + + The endpoint {0} cannot be removed from profile {1} because it's not in the profile. + + + Insufficient parameters passed to create a new endpoint. + + + Ambiguous operation: the profile name specified doesn't match the name of the profile object. + + + <NONE> + + + "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}." + {0} is the HTTP status code. {1} is the Service Management Error Code. {2} is the Service Management Error message. {3} is the operation tracking ID. + + + Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}. + {0} is the string that is not in a valid base 64 format. + + + Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential". + + + Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'? + + + Removing environment + + + There is no subscription associated with account {0}. + + + Account id doesn't match one in subscription. + + + Environment name doesn't match one in subscription. + + + Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile? + + + Removing the Azure profile + + + The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. + + + Account needs to be specified + + + No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription. + + + Path must specify a valid path to an Azure profile. + + + Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token} + + + Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'. + + + Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'. + + + Property bag Hashtable must contain a 'SubscriptionId'. + + + Selected profile must not be null. + + + The Switch-AzureMode cmdlet is deprecated and will be removed in a future release. + + + OperationID : '{0}' + + + Cannot get module for DscResource '{0}'. Possible solutions: +1) Specify -ModuleName for Import-DscResource in your configuration. +2) Unblock module that contains resource. +3) Move Import-DscResource inside Node block. + + 0 = name of DscResource + + + Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version. + {0} = minimal required PS version, {1} = current PS version + + + Parsing configuration script: {0} + {0} is the path to a script file + + + Configuration script '{0}' contained parse errors: +{1} + 0 = path to the configuration script, 1 = parser errors + + + List of required modules: [{0}]. + {0} = list of modules + + + Temp folder '{0}' created. + {0} = temp folder path + + + Copy '{0}' to '{1}'. + {0} = source, {1} = destination + + + Copy the module '{0}' to '{1}'. + {0} = source, {1} = destination + + + File '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the path to a file + + + Configuration file '{0}' not found. + 0 = path to the configuration file + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip). + 0 = path to the configuration file + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1). + 0 = path to the configuration file + + + Create Archive + + + Upload '{0}' + {0} is the name of an storage blob + + + Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the name of an storage blob + + + Configuration published to {0} + {0} is an URI + + + Deleted '{0}' + {0} is the path of a file + + + Cannot delete '{0}': {1} + {0} is the path of a file, {1} is an error message + + + Cannot find the WadCfg end element in the config. + + + WadCfg start element in the config is not matching the end element. + + + Cannot find the WadCfg element in the config. + + + Cannot find configuration data file: {0} + + + The configuration data must be a .psd1 file + + + Cannot change built-in environment {0}. + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. +Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable data collection: PS > Enable-AzDataCollection. + + + Microsoft Azure PowerShell Data Collection Confirmation + + + You choose not to participate in Microsoft Azure PowerShell data collection. + + + This confirmation message will be dismissed in '{0}' second(s)... + + + You choose to participate in Microsoft Azure PowerShell data collection. + + + The setting profile has been saved to the following path '{0}'. + + + [Common.Authentication]: Authenticating for account {0} with single tenant {1}. + + + Changing public environment is not supported. + + + Environment name needs to be specified. + + + Environment needs to be specified. + + + The environment name '{0}' is not found. + + + File path is not valid. + + + Must specify a non-null subscription name. + + + The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription. + + + Removing public environment is not supported. + + + The subscription id {0} doesn't exist. + + + Subscription name needs to be specified. + + + The subscription name {0} doesn't exist. + + + Subscription needs to be specified. + + + User name is not valid. + + + User name needs to be specified. + + + "There is no current context, please log in using Connect-AzAccount." + + + No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount? + + + No certificate was found in the certificate store with thumbprint {0} + + + Illegal characters in path. + + + Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings + + + "{0}" is an invalid DNS name for {1} + + + The provided file in {0} must be have {1} extension + + + {0} is invalid or empty + + + Please connect to internet before executing this cmdlet + + + Path {0} doesn't exist. + + + Path for {0} doesn't exist in {1}. + + + &whr={0} + + + The provided service name {0} already exists, please pick another name + + + Unable to update mismatching Json structured: {0} {1}. + + + (x86) + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. +Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enable-AzureDataCollection. + + + Execution failed because a background thread could not prompt the user. + + + Azure Long-Running Job + + + The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter. + 0(string): exception message in background task + + + Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts. + + + Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter. + + + Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again. + + + Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter. + + + [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}' + 0(bool): whether cmdlet confirmation is required + + + [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}' + 0(string): method type + + + [AzureLongRunningJob]: Completing cmdlet execution in RunJob + + + [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}' + 0(string): last state, 1(string): new state, 2(string): state change reason + + + [AzureLongRunningJob]: Unblocking job due to stoppage or failure + + + [AzureLongRunningJob]: Unblocking job that was previously blocked. + + + [AzureLongRunningJob]: Error in cmdlet execution + + + [AzureLongRunningJob]: Removing state changed event handler, exception '{0}' + 0(string): exception message + + + [AzureLongRunningJob]: ShouldMethod '{0}' unblocked. + 0(string): methodType + + + +- The parameter : '{0}' is changing. + + + +- The parameter : '{0}' is becoming mandatory. + + + +- The parameter : '{0}' is being replaced by parameter : '{1}'. + + + +- The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + + + +- Change description : {0} + + + The cmdlet is being deprecated. There will be no replacement for it. + + + The cmdlet parameter set is being deprecated. There will be no replacement for it. + + + The cmdlet '{0}' is replacing this cmdlet. + + + +- The output type is changing from the existing type :'{0}' to the new type :'{1}' + + + +- The output type '{0}' is changing + + + +- The following properties are being added to the output type : + + + +- The following properties in the output type are being deprecated : + + + {0} + + + +- Cmdlet : '{0}' + - {1} + + + Upcoming breaking changes in the cmdlet '{0}' : + + + +- This change will take effect on '{0}' + + + +- The change is expected to take effect from the version : '{0}' + + + ```powershell +# Old +{0} + +# New +{1} +``` + + + + +Cmdlet invocation changes : + Old Way : {0} + New Way : {1} + + + +The output type '{0}' is being deprecated without a replacement. + + + +The type of the parameter is changing from '{0}' to '{1}'. + + + +Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + + + This cmdlet is in preview. The functionality may not be available in the selected subscription. + + \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Response.cs b/swaggerci/cost-management/generated/runtime/Response.cs new file mode 100644 index 000000000000..0543cda58c2a --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Response.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using System; + using System.Threading.Tasks; + public class Response : EventData + { + public Response() : base() + { + } + } + + public class Response : Response + { + private Func> _resultDelegate; + private Task _resultValue; + + public Response(T value) : base() => _resultValue = Task.FromResult(value); + public Response(Func value) : base() => _resultDelegate = () => Task.FromResult(value()); + public Response(Func> value) : base() => _resultDelegate = value; + public Task Result => _resultValue ?? (_resultValue = this._resultDelegate()); + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/cost-management/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..6d2b5673ff92 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Serialization/JsonSerializer.cs @@ -0,0 +1,350 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal class JsonSerializer + { + private int depth = 0; + + private SerializationOptions options = new SerializationOptions(); + + #region Deserialization + + internal T Deseralize(JsonObject json) + where T : new() + { + var contract = JsonModelCache.Get(typeof(T)); + + return (T)DeserializeObject(contract, json); + } + + internal object DeserializeObject(JsonModel contract, JsonObject json) + { + var instance = Activator.CreateInstance(contract.Type); + + depth++; + + // Ensure we don't recurse forever + if (depth > 5) throw new Exception("Depth greater than 5"); + + foreach (var field in json) + { + var member = contract[field.Key]; + + if (member != null) + { + var value = DeserializeValue(member, field.Value); + + member.SetValue(instance, value); + } + } + + depth--; + + return instance; + } + + private object DeserializeValue(JsonMember member, JsonNode value) + { + if (value.Type == JsonType.Null) return null; + + var type = member.Type; + + if (member.IsStringLike && value.Type != JsonType.String) + { + // Take the long path... + return DeserializeObject(JsonModelCache.Get(type), (JsonObject)value); + } + else if (member.Converter != null) + { + return member.Converter.FromJson(value); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (member.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + private object DeserializeValue(Type type, JsonNode value) + { + if (type == null) throw new ArgumentNullException(nameof(type)); + + if (value.Type == JsonType.Null) return null; + + var typeDetails = TypeDetails.Get(type); + + if (typeDetails.JsonConverter != null) + { + return typeDetails.JsonConverter.FromJson(value); + } + else if (typeDetails.IsEnum) + { + return Enum.Parse(type, value.ToString(), ignoreCase: true); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (typeDetails.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + internal Array DeserializeArray(Type type, JsonArray elements) + { + var elementType = type.GetElementType(); + + var elementTypeDetails = TypeDetails.Get(elementType); + + var array = Array.CreateInstance(elementType, elements.Count); + + int i = 0; + + if (elementTypeDetails.JsonConverter != null) + { + foreach (var value in elements) + { + array.SetValue(elementTypeDetails.JsonConverter.FromJson(value), i); + + i++; + } + } + else + { + foreach (var value in elements) + { + array.SetValue(DeserializeValue(elementType, value), i); + + i++; + } + } + + return array; + } + + internal IList DeserializeList(Type type, JsonArray jsonArray) + { + // TODO: Handle non-generic types + if (!type.IsGenericType) + throw new ArgumentException("Must be a generic type", nameof(type)); + + var elementType = type.GetGenericArguments()[0]; + + IList list; + + if (type.IsInterface) + { + // Create a concrete generic list + list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType)); + } + else + { + list = (IList)Activator.CreateInstance(type); + } + + foreach (var value in jsonArray) + { + list.Add(DeserializeValue(elementType, value)); + } + + return list; + } + + #endregion + + #region Serialization + + internal JsonNode Serialize(object instance) => + Serialize(instance, SerializationOptions.Default); + + internal JsonNode Serialize(object instance, string[] include) => + Serialize(instance, new SerializationOptions { Include = include }); + + internal JsonNode Serialize(object instance, SerializationOptions options) + { + this.options = options; + + if (instance == null) + { + return XNull.Instance; + } + + return ReadValue(instance.GetType(), instance); + } + + #region Readers + + internal JsonArray ReadArray(IEnumerable collection) + { + var array = new XNodeArray(); + + foreach (var item in collection) + { + array.Add(ReadValue(item.GetType(), item)); + } + + return array; + } + + internal IEnumerable> ReadProperties(object instance) + { + var contract = JsonModelCache.Get(instance.GetType()); + + foreach (var member in contract.Members) + { + string name = member.Name; + + if (options.PropertyNameTransformer != null) + { + name = options.PropertyNameTransformer.Invoke(name); + } + + // Skip the field if it's not included + if ((depth == 1 && !options.IsIncluded(name))) + { + continue; + } + + var value = member.GetValue(instance); + + if (!member.EmitDefaultValue && (value == null || (member.IsList && ((IList)value).Count == 0) || value.Equals(member.DefaultValue))) + { + continue; + } + else if (options.IgnoreNullValues && value == null) // Ignore null values + { + continue; + } + + // Transform the value if there is one + if (options.Transformations != null) + { + var transform = options.GetTransformation(name); + + if (transform != null) + { + value = transform.Transformer(value); + } + } + + yield return new KeyValuePair(name, ReadValue(member.TypeDetails, value)); + } + } + + private JsonObject ReadObject(object instance) + { + depth++; + + // TODO: Guard against a self referencing graph + if (depth > options.MaxDepth) + { + depth--; + + return new JsonObject(); + } + + var node = new JsonObject(ReadProperties(instance)); + + depth--; + + return node; + } + + private JsonNode ReadValue(Type type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + var member = TypeDetails.Get(type); + + return ReadValue(member, value); + } + + private JsonNode ReadValue(TypeDetails type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + if (type.JsonConverter != null) + { + return type.JsonConverter.ToJson(value); + } + else if (type.IsArray) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateArray((string[])value); + case TypeCode.UInt16: return CreateArray((ushort[])value); + case TypeCode.UInt32: return CreateArray((uint[])value); + case TypeCode.UInt64: return CreateArray((ulong[])value); + case TypeCode.Int16: return CreateArray((short[])value); + case TypeCode.Int32: return CreateArray((int[])value); + case TypeCode.Int64: return CreateArray((long[])value); + case TypeCode.Single: return CreateArray((float[])value); + case TypeCode.Double: return CreateArray((double[])value); + default: return ReadArray((IEnumerable)value); + } + } + else if (value is IEnumerable) + { + if (type.IsList && type.ElementType != null) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateList(value); + case TypeCode.UInt16: return CreateList(value); + case TypeCode.UInt32: return CreateList(value); + case TypeCode.UInt64: return CreateList(value); + case TypeCode.Int16: return CreateList(value); + case TypeCode.Int32: return CreateList(value); + case TypeCode.Int64: return CreateList(value); + case TypeCode.Single: return CreateList(value); + case TypeCode.Double: return CreateList(value); + } + } + + return ReadArray((IEnumerable)value); + } + else + { + // Complex object + return ReadObject(value); + } + } + + private XList CreateList(object value) => new XList((IList)value); + + private XImmutableArray CreateArray(T[] array) => new XImmutableArray(array); + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/cost-management/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..add627fc7039 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Serialization/PropertyTransformation.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal class PropertyTransformation + { + internal PropertyTransformation(string name, Func transformer) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Transformer = transformer ?? throw new ArgumentNullException(nameof(transformer)); + } + + internal string Name { get; } + + internal Func Transformer { get; } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/cost-management/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..c71dc4e10e4f --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Serialization/SerializationOptions.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal class SerializationOptions + { + internal static readonly SerializationOptions Default = new SerializationOptions(); + + internal SerializationOptions() { } + + internal SerializationOptions( + string[] include = null, + bool ingoreNullValues = false) + { + Include = include; + IgnoreNullValues = ingoreNullValues; + } + + internal string[] Include { get; set; } + + internal string[] Exclude { get; set; } + + internal bool IgnoreNullValues { get; set; } + + internal PropertyTransformation[] Transformations { get; set; } + + internal Func PropertyNameTransformer { get; set; } + + internal int MaxDepth { get; set; } = 5; + + internal bool IsIncluded(string name) + { + if (Exclude != null) + { + return !Exclude.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + else if (Include != null) + { + return Include.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + + return true; + } + + internal PropertyTransformation GetTransformation(string propertyName) + { + if (Transformations == null) return null; + + foreach (var t in Transformations) + { + if (t.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + { + return t; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/SerializationMode.cs b/swaggerci/cost-management/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..369c1c049edf --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/SerializationMode.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + [System.Flags] + public enum SerializationMode + { + None = 0, + IncludeHeaders = 1 << 0, + IncludeReadOnly = 1 << 1, + + IncludeAll = IncludeHeaders | IncludeReadOnly + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/TypeConverterExtensions.cs b/swaggerci/cost-management/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..16720fd8b01f --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/TypeConverterExtensions.cs @@ -0,0 +1,211 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Linq; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.PowerShell +{ + internal static class TypeConverterExtensions + { + internal static T[] SelectToArray(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) }; + } +#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]; // 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.ToArray(); + } + + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Management.Automation.PSObject instance) + { + if (null != instance) + { + foreach (var each in instance.Properties) + { + yield return each; + } + } + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.Generic.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys.OfType() + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Management.Automation.PSObject instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + // new global::System.Collections.Generic.HashSet(System.StringComparer.InvariantCultureIgnoreCase) + return (null == instance || !instance.Properties.Any()) ? + Enumerable.Empty>() : + instance.Properties + .Where(property => + !(true == exclusions?.Contains(property.Name)) + && (false != inclusions?.Contains(property.Name))) + .Select(property => new System.Collections.Generic.KeyValuePair(property.Name, property.Value)); + } + + + internal static T GetValueForProperty(this System.Collections.Generic.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys, each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + internal static T GetValueForProperty(this System.Collections.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys.OfType(), each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static T GetValueForProperty(this System.Management.Automation.PSObject psObject, string propertyName, T defaultValue, System.Func converter) + { + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return property == null ? defaultValue : (T)converter(property.Value); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static bool Contains(this System.Management.Automation.PSObject psObject, string propertyName) + { + bool result = false; + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + result = property == null ? false : true; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return result; + } + } +} diff --git a/swaggerci/cost-management/generated/runtime/UndeclaredResponseException.cs b/swaggerci/cost-management/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..fbdbe3a20b36 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/UndeclaredResponseException.cs @@ -0,0 +1,112 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Extensions; + + public class RestException : Exception, IDisposable + { + public System.Net.HttpStatusCode StatusCode { get; set; } + public string Code { get; protected set; } + protected string message; + public HttpRequestMessage RequestMessage { get; protected set; } + public HttpResponseHeaders ResponseHeaders { get; protected set; } + + public string ResponseBody { get; protected set; } + public string ClientRequestId { get; protected set; } + public string RequestId { get; protected set; } + + public override string Message => message; + public string Action { get; protected set; } + + public RestException(System.Net.Http.HttpResponseMessage response) + { + StatusCode = response.StatusCode; + //CloneWithContent will not work here since the content is disposed after sendAsync + //Besides, it seems there is no need for the request content cloned here. + RequestMessage = response.RequestMessage.Clone(); + ResponseBody = response.Content.ReadAsStringAsync().Result; + ResponseHeaders = response.Headers; + + RequestId = response.GetFirstHeader("x-ms-request-id"); + ClientRequestId = response.GetFirstHeader("x-ms-client-request-id"); + + try + { + // try to parse the body as JSON, and see if a code and message are in there. + var json = Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json.JsonObject; + + // error message could be in properties.statusMessage + { message = If(json?.Property("properties"), out var p) + && If(p?.PropertyT("statusMessage"), out var sm) + ? (string)sm : (string)Message; } + + // see if there is an error block in the body + json = json?.Property("error") ?? json; + + { Code = If(json?.PropertyT("code"), out var c) ? (string)c : (string)StatusCode.ToString(); } + { message = If(json?.PropertyT("message"), out var m) ? (string)m : (string)Message; } + { Action = If(json?.PropertyT("action"), out var a) ? (string)a : (string)Action; } + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // couldn't get the code/message from the body response. + // In this case, we will assume the response is the expected error message + if(!string.IsNullOrEmpty(ResponseBody)) { + message = ResponseBody; + } + } +#endif + if (string.IsNullOrEmpty(message)) + { + if (StatusCode >= System.Net.HttpStatusCode.BadRequest && StatusCode < System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Request Error, Status: {StatusCode}"; + } + else if (StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Server Error, Status: {StatusCode}"; + } + else + { + message = $"The server responded with an unrecognized response, Status: {StatusCode}"; + } + } + } + + public void Dispose() + { + ((IDisposable)RequestMessage).Dispose(); + } + } + + public class RestException : RestException + { + public T Error { get; protected set; } + public RestException(System.Net.Http.HttpResponseMessage response, T error) : base(response) + { + Error = error; + } + } + + + public class UndeclaredResponseException : RestException + { + public UndeclaredResponseException(System.Net.Http.HttpResponseMessage response) : base(response) + { + + } + } +} \ No newline at end of file diff --git a/swaggerci/cost-management/generated/runtime/Writers/JsonWriter.cs b/swaggerci/cost-management/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..8b2b2cdcf050 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/Writers/JsonWriter.cs @@ -0,0 +1,223 @@ +/*--------------------------------------------------------------------------------------------- + * 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; +using System.IO; +using System.Web; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Json +{ + internal class JsonWriter + { + const string indentation = " "; // 2 spaces + + private readonly bool pretty; + private readonly TextWriter writer; + + protected int currentLevel = 0; + + internal JsonWriter(TextWriter writer, bool pretty = true) + { + this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); + this.pretty = pretty; + } + + internal void WriteNode(JsonNode node) + { + switch (node.Type) + { + case JsonType.Array: WriteArray((IEnumerable)node); break; + case JsonType.Object: WriteObject((JsonObject)node); break; + + // Primitives + case JsonType.Binary: WriteBinary((XBinary)node); break; + case JsonType.Boolean: WriteBoolean((bool)node); break; + case JsonType.Date: WriteDate((JsonDate)node); break; + case JsonType.Null: WriteNull(); break; + case JsonType.Number: WriteNumber((JsonNumber)node); break; + case JsonType.String: WriteString(node); break; + } + } + + internal void WriteArray(IEnumerable array) + { + currentLevel++; + + writer.Write('['); + + bool doIndentation = false; + + if (pretty) + { + foreach (var node in array) + { + if (node.Type == JsonType.Object || node.Type == JsonType.Array) + { + doIndentation = true; + + break; + } + } + } + + bool isFirst = true; + + foreach (JsonNode node in array) + { + if (!isFirst) writer.Write(','); + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + WriteNode(node); + + isFirst = false; + } + + currentLevel--; + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + writer.Write(']'); + } + + internal void WriteIndent() + { + if (pretty) + { + writer.Write(Environment.NewLine); + + for (int level = 0; level < currentLevel; level++) + { + writer.Write(indentation); + } + } + } + + internal void WriteObject(JsonObject obj) + { + currentLevel++; + + writer.Write('{'); + + bool isFirst = true; + + foreach (var field in obj) + { + if (!isFirst) writer.Write(','); + + WriteIndent(); + + WriteFieldName(field.Key); + + writer.Write(':'); + + if (pretty) + { + writer.Write(' '); + } + + // Write the field value + WriteNode(field.Value); + + isFirst = false; + } + + currentLevel--; + + WriteIndent(); + + writer.Write('}'); + } + + internal void WriteFieldName(string fieldName) + { + writer.Write('"'); + writer.Write(HttpUtility.JavaScriptStringEncode(fieldName)); + writer.Write('"'); + } + + #region Primitives + + internal void WriteBinary(XBinary value) + { + writer.Write('"'); + writer.Write(value.ToString()); + writer.Write('"'); + } + + internal void WriteBoolean(bool value) + { + writer.Write(value ? "true" : "false"); + } + + internal void WriteDate(JsonDate date) + { + if (date.ToDateTime().Year == 1) + { + WriteNull(); + } + else + { + writer.Write('"'); + writer.Write(date.ToIsoString()); + writer.Write('"'); + } + } + + internal void WriteNull() + { + writer.Write("null"); + } + + internal void WriteNumber(JsonNumber number) + { + if (number.Overflows) + { + writer.Write('"'); + writer.Write(number.Value); + writer.Write('"'); + } + else + { + writer.Write(number.Value); + } + } + + internal void WriteString(string text) + { + if (text == null) + { + WriteNull(); + } + else + { + writer.Write('"'); + + writer.Write(HttpUtility.JavaScriptStringEncode(text)); + + writer.Write('"'); + } + } + + #endregion + } +} + + +// TODO: Replace with System.Text.Json when available diff --git a/swaggerci/cost-management/generated/runtime/delegates.cs b/swaggerci/cost-management/generated/runtime/delegates.cs new file mode 100644 index 000000000000..72c2a27f5a53 --- /dev/null +++ b/swaggerci/cost-management/generated/runtime/delegates.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * 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.Cost.Runtime +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData=System.Func; + + public delegate Task SendAsync(HttpRequestMessage request, IEventListener callback); + public delegate Task SendAsyncStep(HttpRequestMessage request, IEventListener callback, ISendAsync next); + public delegate Task SignalEvent(string id, CancellationToken token, GetEventData getEventData); + public delegate Task Event(EventData message); + public delegate void SynchEvent(EventData message); + public delegate Task OnResponse(Response message); + public delegate Task OnResponse(Response message); +} \ No newline at end of file diff --git a/swaggerci/cost-management/how-to.md b/swaggerci/cost-management/how-to.md new file mode 100644 index 000000000000..928b45c79f8b --- /dev/null +++ b/swaggerci/cost-management/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.Cost`. + +## Building `Az.Cost` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder. + +## Testing `Az.Cost` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. + +## Packing `Az.Cost` +To pack `Az.Cost` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.Cost`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.Cost.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.Cost.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.Cost`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.Cost` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/swaggerci/cost-management/internal/Az.Cost.internal.psm1 b/swaggerci/cost-management/internal/Az.Cost.internal.psm1 new file mode 100644 index 000000000000..e8c83de121f2 --- /dev/null +++ b/swaggerci/cost-management/internal/Az.Cost.internal.psm1 @@ -0,0 +1,38 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Cost.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Module]::Instance + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = $PSScriptRoot + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } +# endregion diff --git a/swaggerci/cost-management/internal/Get-AzCostOperation.ps1 b/swaggerci/cost-management/internal/Get-AzCostOperation.ps1 new file mode 100644 index 000000000000..c043effa5bc9 --- /dev/null +++ b/swaggerci/cost-management/internal/Get-AzCostOperation.ps1 @@ -0,0 +1,116 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists all of the available cost management REST API operations. +.Description +Lists all of the available cost management REST API operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostoperation +#> +function Get-AzCostOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.Cost.private\Get-AzCostOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/cost-management/internal/ProxyCmdletDefinitions.ps1 b/swaggerci/cost-management/internal/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..c043effa5bc9 --- /dev/null +++ b/swaggerci/cost-management/internal/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,116 @@ + +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists all of the available cost management REST API operations. +.Description +Lists all of the available cost management REST API operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostoperation +#> +function Get-AzCostOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.Cost.private\Get-AzCostOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/cost-management/internal/README.md b/swaggerci/cost-management/internal/README.md new file mode 100644 index 000000000000..a6956e18e47b --- /dev/null +++ b/swaggerci/cost-management/internal/README.md @@ -0,0 +1,14 @@ +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.Cost.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.Cost`. Instead, this sub-module is imported by the `../custom/Az.Cost.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.Cost.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.Cost`. diff --git a/swaggerci/cost-management/license.txt b/swaggerci/cost-management/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/cost-management/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/swaggerci/cost-management/pack-module.ps1 b/swaggerci/cost-management/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/cost-management/pack-module.ps1 @@ -0,0 +1,9 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +Write-Host -ForegroundColor Green 'Packing module...' +dotnet pack $PSScriptRoot --no-build /nologo +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/cost-management/readme.md b/swaggerci/cost-management/readme.md new file mode 100644 index 000000000000..246b94b2684a --- /dev/null +++ b/swaggerci/cost-management/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../tools/SwaggerCI/readme.azure.noprofile.md + - $(this-folder)/../../../azure-rest-api-specs/specification/cost-management/resource-manager/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/cost-management/resource-manager/readme.powershell.md +``` diff --git a/swaggerci/cost-management/resources/README.md b/swaggerci/cost-management/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/cost-management/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/swaggerci/cost-management/run-module.ps1 b/swaggerci/cost-management/run-module.ps1 new file mode 100644 index 000000000000..7bdd59f2e739 --- /dev/null +++ b/swaggerci/cost-management/run-module.ps1 @@ -0,0 +1,54 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Code) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$isAzure = $true +if($isAzure) { + . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts + # Load the latest version of Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.Cost.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +function Prompt { + Write-Host -NoNewline -ForegroundColor Green "PS $(Get-Location)" + Write-Host -NoNewline -ForegroundColor Gray ' [' + Write-Host -NoNewline -ForegroundColor White -BackgroundColor DarkCyan $moduleName + ']> ' +} + +# where we would find the launch.json file +$vscodeDirectory = New-Item -ItemType Directory -Force -Path (Join-Path $PSScriptRoot '.vscode') +$launchJson = Join-Path $vscodeDirectory 'launch.json' + +# if there is a launch.json file, let's just assume -Code, and update the file +if(($Code) -or (test-Path $launchJson) ) { + $launchContent = '{ "version": "0.2.0", "configurations":[{ "name":"Attach to PowerShell", "type":"coreclr", "request":"attach", "processId":"' + ([System.Diagnostics.Process]::GetCurrentProcess().Id) + '", "justMyCode":false }] }' + Set-Content -Path $launchJson -Value $launchContent + if($Code) { + # only launch vscode if they say -code + code $PSScriptRoot + } +} + +Import-Module -Name $modulePath \ No newline at end of file diff --git a/swaggerci/cost-management/test-module.ps1 b/swaggerci/cost-management/test-module.ps1 new file mode 100644 index 000000000000..c5b68d3d1fd1 --- /dev/null +++ b/swaggerci/cost-management/test-module.ps1 @@ -0,0 +1,86 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) +{ + 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 + return +} + +# This is a workaround, since for string array parameter, pwsh -File will only take the first element +if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and ($TestName[0].Contains(','))) { + $TestName = $TestName[0].Split(",") +} + +$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 +. ("$PSScriptRoot\test\utils.ps1") + +if ($requireResourceModule) +{ + # Load the latest Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version + $resourceModulePSD = Get-Item -Path (Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psd1') + Import-Module -Name $resourceModulePSD.FullName +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) +{ + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.Cost.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +Import-Module -Name Pester +Import-Module -Name $modulePath + +$TestMode = 'playback' +$ExcludeTag = @("LiveOnly") +if($Live) +{ + $TestMode = 'live' + $ExcludeTag = @() +} +if($Record) +{ + $TestMode = 'record' +} +try +{ + if ($TestMode -ne 'playback') + { + setupEnv + } + $testFolder = Join-Path $PSScriptRoot 'test' + if ($null -ne $TestName) + { + Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } else + { + Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } +} Finally +{ + if ($TestMode -ne 'playback') + { + cleanupEnv + } +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/cost-management/test/Get-AzCostAlert.Tests.ps1 b/swaggerci/cost-management/test/Get-AzCostAlert.Tests.ps1 new file mode 100644 index 000000000000..ee59f5768858 --- /dev/null +++ b/swaggerci/cost-management/test/Get-AzCostAlert.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCostAlert')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostAlert.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzCostAlert' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Get-AzCostAlertExternal.Tests.ps1 b/swaggerci/cost-management/test/Get-AzCostAlertExternal.Tests.ps1 new file mode 100644 index 000000000000..43dc56e90cc4 --- /dev/null +++ b/swaggerci/cost-management/test/Get-AzCostAlertExternal.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCostAlertExternal')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostAlertExternal.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzCostAlertExternal' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Get-AzCostDimension.Tests.ps1 b/swaggerci/cost-management/test/Get-AzCostDimension.Tests.ps1 new file mode 100644 index 000000000000..89c3b32c4e52 --- /dev/null +++ b/swaggerci/cost-management/test/Get-AzCostDimension.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCostDimension')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostDimension.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzCostDimension' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Get-AzCostExport.Tests.ps1 b/swaggerci/cost-management/test/Get-AzCostExport.Tests.ps1 new file mode 100644 index 000000000000..f112068a00b0 --- /dev/null +++ b/swaggerci/cost-management/test/Get-AzCostExport.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCostExport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostExport.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzCostExport' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Get-AzCostExportExecutionHistory.Tests.ps1 b/swaggerci/cost-management/test/Get-AzCostExportExecutionHistory.Tests.ps1 new file mode 100644 index 000000000000..d6e702560bda --- /dev/null +++ b/swaggerci/cost-management/test/Get-AzCostExportExecutionHistory.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCostExportExecutionHistory')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostExportExecutionHistory.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzCostExportExecutionHistory' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Get-AzCostGenerateCostDetailReportOperationResult.Tests.ps1 b/swaggerci/cost-management/test/Get-AzCostGenerateCostDetailReportOperationResult.Tests.ps1 new file mode 100644 index 000000000000..e869423f3512 --- /dev/null +++ b/swaggerci/cost-management/test/Get-AzCostGenerateCostDetailReportOperationResult.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCostGenerateCostDetailReportOperationResult')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostGenerateCostDetailReportOperationResult.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzCostGenerateCostDetailReportOperationResult' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Get-AzCostGenerateDetailedCostReportOperationResult.Tests.ps1 b/swaggerci/cost-management/test/Get-AzCostGenerateDetailedCostReportOperationResult.Tests.ps1 new file mode 100644 index 000000000000..252194916f0e --- /dev/null +++ b/swaggerci/cost-management/test/Get-AzCostGenerateDetailedCostReportOperationResult.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCostGenerateDetailedCostReportOperationResult')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostGenerateDetailedCostReportOperationResult.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzCostGenerateDetailedCostReportOperationResult' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Get-AzCostGenerateDetailedCostReportOperationStatus.Tests.ps1 b/swaggerci/cost-management/test/Get-AzCostGenerateDetailedCostReportOperationStatus.Tests.ps1 new file mode 100644 index 000000000000..f1596f9e252f --- /dev/null +++ b/swaggerci/cost-management/test/Get-AzCostGenerateDetailedCostReportOperationStatus.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCostGenerateDetailedCostReportOperationStatus')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostGenerateDetailedCostReportOperationStatus.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzCostGenerateDetailedCostReportOperationStatus' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Get-AzCostView.Tests.ps1 b/swaggerci/cost-management/test/Get-AzCostView.Tests.ps1 new file mode 100644 index 000000000000..f52986cb94a4 --- /dev/null +++ b/swaggerci/cost-management/test/Get-AzCostView.Tests.ps1 @@ -0,0 +1,41 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzCostView')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostView.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzCostView' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Invoke-AzCostByDimensionExternalCloudProviderType.Tests.ps1 b/swaggerci/cost-management/test/Invoke-AzCostByDimensionExternalCloudProviderType.Tests.ps1 new file mode 100644 index 000000000000..dae9d0013bf2 --- /dev/null +++ b/swaggerci/cost-management/test/Invoke-AzCostByDimensionExternalCloudProviderType.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzCostByDimensionExternalCloudProviderType')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostByDimensionExternalCloudProviderType.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzCostByDimensionExternalCloudProviderType' { + It 'By' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ByViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.Tests.ps1 b/swaggerci/cost-management/test/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.Tests.ps1 new file mode 100644 index 000000000000..5e32baf3999b --- /dev/null +++ b/swaggerci/cost-management/test/Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzCostByGenerateReservationDetailReportBillingAccountId')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostByGenerateReservationDetailReportBillingAccountId.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzCostByGenerateReservationDetailReportBillingAccountId' { + It 'By' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ByViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.Tests.ps1 b/swaggerci/cost-management/test/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.Tests.ps1 new file mode 100644 index 000000000000..c82bd65b8a23 --- /dev/null +++ b/swaggerci/cost-management/test/Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzCostByGenerateReservationDetailReportBillingProfileId')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostByGenerateReservationDetailReportBillingProfileId.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzCostByGenerateReservationDetailReportBillingProfileId' { + It 'By' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ByViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Invoke-AzCostCloudForecast.Tests.ps1 b/swaggerci/cost-management/test/Invoke-AzCostCloudForecast.Tests.ps1 new file mode 100644 index 000000000000..c428ee0ad47d --- /dev/null +++ b/swaggerci/cost-management/test/Invoke-AzCostCloudForecast.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzCostCloudForecast')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostCloudForecast.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzCostCloudForecast' { + It 'CloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Cloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CloudViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CloudViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Invoke-AzCostDismissAlert.Tests.ps1 b/swaggerci/cost-management/test/Invoke-AzCostDismissAlert.Tests.ps1 new file mode 100644 index 000000000000..96cf5891b432 --- /dev/null +++ b/swaggerci/cost-management/test/Invoke-AzCostDismissAlert.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzCostDismissAlert')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostDismissAlert.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzCostDismissAlert' { + It 'DismissExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Dismiss' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DismissViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DismissViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Invoke-AzCostExecuteExport.Tests.ps1 b/swaggerci/cost-management/test/Invoke-AzCostExecuteExport.Tests.ps1 new file mode 100644 index 000000000000..3fef53484a60 --- /dev/null +++ b/swaggerci/cost-management/test/Invoke-AzCostExecuteExport.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzCostExecuteExport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostExecuteExport.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzCostExecuteExport' { + It 'Execute' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ExecuteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Invoke-AzCostUsageForecast.Tests.ps1 b/swaggerci/cost-management/test/Invoke-AzCostUsageForecast.Tests.ps1 new file mode 100644 index 000000000000..a1932a7cb94d --- /dev/null +++ b/swaggerci/cost-management/test/Invoke-AzCostUsageForecast.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzCostUsageForecast')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostUsageForecast.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzCostUsageForecast' { + It 'UsageExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Usage' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UsageViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UsageViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Invoke-AzCostUsageQuery.Tests.ps1 b/swaggerci/cost-management/test/Invoke-AzCostUsageQuery.Tests.ps1 new file mode 100644 index 000000000000..1b8364268832 --- /dev/null +++ b/swaggerci/cost-management/test/Invoke-AzCostUsageQuery.Tests.ps1 @@ -0,0 +1,49 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzCostUsageQuery')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostUsageQuery.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzCostUsageQuery' { + It 'UsageExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Usage' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UsageExpanded1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Usage1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UsageViaIdentityExpanded1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UsageViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UsageViaIdentity1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UsageViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/New-AzCostExport.Tests.ps1 b/swaggerci/cost-management/test/New-AzCostExport.Tests.ps1 new file mode 100644 index 000000000000..3042b1c66c46 --- /dev/null +++ b/swaggerci/cost-management/test/New-AzCostExport.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzCostExport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzCostExport.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzCostExport' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/New-AzCostGenerateCostDetailReportOperation.Tests.ps1 b/swaggerci/cost-management/test/New-AzCostGenerateCostDetailReportOperation.Tests.ps1 new file mode 100644 index 000000000000..cb8083615426 --- /dev/null +++ b/swaggerci/cost-management/test/New-AzCostGenerateCostDetailReportOperation.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzCostGenerateCostDetailReportOperation')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzCostGenerateCostDetailReportOperation.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzCostGenerateCostDetailReportOperation' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/New-AzCostGenerateDetailedCostReportOperation.Tests.ps1 b/swaggerci/cost-management/test/New-AzCostGenerateDetailedCostReportOperation.Tests.ps1 new file mode 100644 index 000000000000..114dbd0572a4 --- /dev/null +++ b/swaggerci/cost-management/test/New-AzCostGenerateDetailedCostReportOperation.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzCostGenerateDetailedCostReportOperation')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzCostGenerateDetailedCostReportOperation.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzCostGenerateDetailedCostReportOperation' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/New-AzCostView.Tests.ps1 b/swaggerci/cost-management/test/New-AzCostView.Tests.ps1 new file mode 100644 index 000000000000..9cb1f49fa255 --- /dev/null +++ b/swaggerci/cost-management/test/New-AzCostView.Tests.ps1 @@ -0,0 +1,37 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzCostView')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzCostView.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzCostView' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateExpanded1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Create1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentity1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/README.md b/swaggerci/cost-management/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/cost-management/test/README.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/swaggerci/cost-management/test/Remove-AzCostExport.Tests.ps1 b/swaggerci/cost-management/test/Remove-AzCostExport.Tests.ps1 new file mode 100644 index 000000000000..1b4e4c17e5a7 --- /dev/null +++ b/swaggerci/cost-management/test/Remove-AzCostExport.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzCostExport')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzCostExport.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzCostExport' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/Remove-AzCostView.Tests.ps1 b/swaggerci/cost-management/test/Remove-AzCostView.Tests.ps1 new file mode 100644 index 000000000000..736fd7ce0b9e --- /dev/null +++ b/swaggerci/cost-management/test/Remove-AzCostView.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzCostView')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzCostView.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzCostView' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Delete1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/cost-management/test/loadEnv.ps1 b/swaggerci/cost-management/test/loadEnv.ps1 new file mode 100644 index 000000000000..0ea394729062 --- /dev/null +++ b/swaggerci/cost-management/test/loadEnv.ps1 @@ -0,0 +1,21 @@ +# ---------------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------------- +$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 + $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/swaggerci/cost-management/test/utils.ps1 b/swaggerci/cost-management/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/cost-management/test/utils.ps1 @@ -0,0 +1,31 @@ +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]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} + diff --git a/swaggerci/cost-management/utils/Unprotect-SecureString.ps1 b/swaggerci/cost-management/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/cost-management/utils/Unprotect-SecureString.ps1 @@ -0,0 +1,16 @@ +#This script converts securestring to plaintext + +param( + [Parameter(Mandatory, ValueFromPipeline)] + [System.Security.SecureString] + ${SecureString} +) + +$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) +try { + $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) +} finally { + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) +} + +return $plaintext \ No newline at end of file